<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Adding in drivers into zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80747/adding-in-drivers-into-zephyr</link><description>Hey all trying to understand how to add in drivers from zephyr into my project. an example like adding the w5500 module would that ential something like this ? -1) copy contents of kconfig file into source kconfig (file: Kconfig.w5500 into -&amp;gt; prj.conf</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Oct 2021 23:26:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80747/adding-in-drivers-into-zephyr" /><item><title>RE: Adding in drivers into zephyr</title><link>https://devzone.nordicsemi.com/thread/335164?ContentTypeID=1</link><pubDate>Wed, 20 Oct 2021 23:26:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d58f5cf-cec6-4db2-8fb2-e8a8e340580e</guid><dc:creator>lolcatsnin</dc:creator><description>&lt;p&gt;Ah ok, i was given the impression there were more hoops to be jumped haha.&lt;br /&gt;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding in drivers into zephyr</title><link>https://devzone.nordicsemi.com/thread/335136?ContentTypeID=1</link><pubDate>Wed, 20 Oct 2021 15:03:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2274443d-171b-4a55-b831-a965b407466b</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="lolcatsnin"]whats the alternative approach&amp;nbsp;&amp;nbsp;[/quote]
&lt;p&gt;The alternative is to implement your wanted functionality on top of a standard driver. For instance, if using a SPI based sensor, then you add the communication on top of the zephyr spi driver directly in your application.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding in drivers into zephyr</title><link>https://devzone.nordicsemi.com/thread/335121?ContentTypeID=1</link><pubDate>Wed, 20 Oct 2021 13:19:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4e5acf8-63b2-44f5-8ad8-821048f74504</guid><dc:creator>lolcatsnin</dc:creator><description>&lt;p&gt;ah ok appreciate it !! i havnt seen those pages.&lt;br /&gt;&lt;br /&gt; whats the alternative approach&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding in drivers into zephyr</title><link>https://devzone.nordicsemi.com/thread/335062?ContentTypeID=1</link><pubDate>Wed, 20 Oct 2021 11:19:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dceb341-d2a2-43e6-9780-a35f29aa655c</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="lolcatsnin"]so in the case that the driver isnt a zephyr component does that make it alot harder to add in ?&amp;nbsp; is there a template/ tutorial / page on the matter ?[/quote]
&lt;p&gt;If the component/driver isn&amp;#39;t already present in zephyr, and you want to add it in the &amp;quot;zephyr way&amp;quot;, I&amp;#39;d recommend reading the zephyr documentation, and its driver model:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/latest/reference/drivers/index.html"&gt;https://docs.zephyrproject.org/latest/reference/drivers/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And the device tree:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/latest/reference/devicetree/index.html"&gt;https://docs.zephyrproject.org/latest/reference/devicetree/index.html#&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding in drivers into zephyr</title><link>https://devzone.nordicsemi.com/thread/335040?ContentTypeID=1</link><pubDate>Wed, 20 Oct 2021 09:51:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e32b8874-0ad3-4d6f-9f8d-706efa26012a</guid><dc:creator>lolcatsnin</dc:creator><description>&lt;p&gt;ah ok, thanks for your advice ! i was thinking about just ripping/copying out one of the other drivers that im familiar with and attempting to swap out and integrate it if required but i cant seem to find much on the matter on what is required to nicely have things fit in haha.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding in drivers into zephyr</title><link>https://devzone.nordicsemi.com/thread/335038?ContentTypeID=1</link><pubDate>Wed, 20 Oct 2021 09:48:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1eae07b9-8556-4ad6-8d24-35dbc2c64c18</guid><dc:creator>lolcatsnin</dc:creator><description>&lt;p&gt;Sorry for the delay. oh ok, so just to reitterate&amp;nbsp;&lt;br /&gt;CONFIG_NETWORKING=y&lt;br /&gt;CONFIG_NET_L2_ETHERNET=y&lt;br /&gt;CONFIG_ETH_W5500=y&lt;br /&gt;alone link the drivers to the project.&lt;br /&gt;&lt;br /&gt;so in the case that the driver isnt a zephyr component does that make it alot harder to add in ?&amp;nbsp; is there a template/ tutorial / page on the matter ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding in drivers into zephyr</title><link>https://devzone.nordicsemi.com/thread/334549?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 10:39:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5701243f-e9df-4143-928f-ec6365138711</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This driver is a zephyr component, but I&amp;#39;ll try to help you along the way.&lt;/p&gt;
&lt;p&gt;You need to first add the dependencies of the device itself, which is the transport layer (SPI) and the net stack in zephyr:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SPI=y
CONFIG_NETWORKING=y
CONFIG_NET_L2_ETHERNET=y
CONFIG_ETH_W5500=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And you need to define the device in device tree as well. This can be done by creating the my-application/boards folder, and $(BOARD).overlay (for example: boards/nrf5340dk_nrf5340_cpuapp.overlay), which should hold the peripheral and device specific declaration:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi3 {
        sck-pin = &amp;lt;47&amp;gt;;
        miso-pin = &amp;lt;46&amp;gt;;
        mosi-pin = &amp;lt;45&amp;gt;;
        cs-gpios = &amp;lt;&amp;amp;gpio0 21 GPIO_ACTIVE_LOW&amp;gt;;
        status = &amp;quot;okay&amp;quot;;
        w5500: w5500@0 {
                compatible = &amp;quot;wiznet,w5500&amp;quot;;
                label = &amp;quot;w5500&amp;quot;;
                reg = &amp;lt;0&amp;gt;;
                spi-max-frequency = &amp;lt;1000000&amp;gt;;
                int-gpios = &amp;lt;&amp;amp;gpio0 20 GPIO_ACTIVE_LOW&amp;gt;;
// optional:             reset-gpios = &amp;lt;&amp;amp;gpio0 21 GPIO_ACTIVE_LOW&amp;gt;;
        };
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that the above is provided as an example, please change the GPIOs to match your wanted pins.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding in drivers into zephyr</title><link>https://devzone.nordicsemi.com/thread/334455?ContentTypeID=1</link><pubDate>Sun, 17 Oct 2021 15:25:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2eae71be-8bfb-4809-a183-6cc04022e011</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Good morning @&lt;span class="user-name"&gt;&lt;span class="ui-userpresence ui-tip "&gt;&lt;/span&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/lolcatsnin"&gt;lolcatsnin,&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="user-name"&gt;Fellow Devzone developer Ted here.&amp;nbsp; I will be watching replies to your posted question as it&amp;#39;s closely related to a Zephyr driver integration problem I was about to post here myself.&amp;nbsp; I am sorry I do not have a ready solution to share with you right now.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="user-name"&gt;On my side I am trying to integrate the driver for STMicro&amp;#39;s IIS2DH accelerometer into a small Zephyr app of my own, which presently targets Sparkfun&amp;#39;s Thing Plus nRF9160 development board.&amp;nbsp; Nordic Semi&amp;#39;s sdk-nrf includes a sample app for the closely related LIS2DH, and there are drivers for both these parts in sdk-nrf v1.6.1 modules project.&amp;nbsp; I think these may be considered &amp;quot;out-of-tree&amp;quot; drivers because they&amp;#39;re located in a &amp;#39;modules&amp;#39; directory that is cloned along side Nordic&amp;#39;s fork of the Zephyr project.&amp;nbsp; They&amp;#39;re not located under the &amp;#39;zephyr&amp;#39; directory at the top level of the SDK.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="user-name"&gt;In general I believe you are on the right track.&amp;nbsp; To enable `cmake` to find IIS2DH header file I needed to add a line to my project&amp;#39;s CMakeLists.txt file that&amp;#39;s of the form of your line above, `zephyr_include_directories(${ZEPHYR_BASE}/subsys/net/l2)`.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="user-name"&gt;In your work I am unsure about directly copying contents of a Kconfig file into prj.conf.&amp;nbsp; These two file types seem to have somewhat different syntax.&amp;nbsp; Kconfig files express which kernel options and option inter-dependencies are available and present.&amp;nbsp; Prj.conf enables them with the &amp;#39;symbol=value&amp;#39; syntax.&amp;nbsp; But these two files are closely related in a given Zephyr based project.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="user-name"&gt;- Ted&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>