Re: Driver development on zephyr


Chettimada, Vinayak Kariappa
 

Earlier messages posted on Slack:

 

Nandhakumar Sundarraj Today at 7:44 AM

Hi, Need clarification on driver development on zephyr. We are developing a new chip(ARM Cortex M0+ based SoC) for which Zephyr RTOS would be used. We have seen the driver APIs defined under zephyr/include/drivers and zephyr/driver folders(e.g, uart.h, spi.h, gpio.h).

  1. Is it mandatory to fill the zephyr defined APIs and application should call only zephyr defined APIs? Or can application call our own driver APIs(under modules/hal folder) directly without using zephyr defined APIs?
  2. Is there any advantage of using zephyr defined driver APIs?
  3. In future, if we are open sourcing our code, is it okay to keep our driver under modules/hal instead zephyr/driver?

4 replies


brix  5 hours ago

  1. You can call the HAL directly if needed

brix  5 hours ago

2. Portability

brix  5 hours ago

3. Not likely

vich  5 hours ago

  1. Agree with @brix that you can call your proprietary hal implementation directly, I assume that is from your own application, which probably is now not portable and maintenance is limited by users of this application and by its vendor.
  2. Yes, Portability, with wider audience and better test coverage by those already exists for Zephyr APIs.
  3. Not likely for direct proprietary HAL code. But if Zephyr drivers use your HAL that is in a compatible open source license, your HAL can be module like other production ready vendor HAL source code that exists today

-Vinayak

 

From: devel@... <devel@...> On Behalf Of Nandhakumar Sundarraj via lists.zephyrproject.org
Sent: 23 August 2021 07:47
To: devel@...
Subject: [Zephyr-devel] Driver development on zephyr

 

Hi,

 

Need clarification on driver development on zephyr. We are developing a new chip(ARM Cortex M0+ based SoC) for which Zephyr RTOS would be used. We have seen the driver APIs defined under zephyr/include/drivers and zephyr/driver folders(e.g, uart.h, spi.h, gpio.h).

  1. Is it mandatory to fill the zephyr defined APIs and application should call only zephyr defined APIs? Or can application call our own driver APIs(under modules/hal folder) directly without using zephyr defined APIs?
  2. Is there any advantage of using zephyr defined driver APIs?
  3. In future, if we are open sourcing our code, is it okay to keep our driver under modules/hal instead of zephyr/driver?

 

Regards,

Nandhakumar

Join {devel@lists.zephyrproject.org to automatically receive all group messages.