<?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>nRF1960 and Out-of-tree Zephyr new driver development?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78827/nrf1960-and-out-of-tree-zephyr-new-driver-development</link><description>Hello Devzone Community, 
 I&amp;#39;m a couple weeks into learning, working with Nordic ncs, Zephyr RTOS and west and friends. I&amp;#39;m working on an out-of-tree driver, and am stuck at an early during build error relating to the flag which enables the new sensor</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Dec 2021 21:28:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78827/nrf1960-and-out-of-tree-zephyr-new-driver-development" /><item><title>RE: nRF1960 and Out-of-tree Zephyr new driver development?</title><link>https://devzone.nordicsemi.com/thread/345409?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 21:28:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae4e7df7-748c-467e-b633-3b96ef52c21c</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello again Pawel,&lt;/p&gt;
&lt;p&gt;I amend my statement just after the west.yml code excerpt, near end of my reply this hour:&amp;nbsp; if and when in your project you are able to invoke `west update` and confirm that you are now downloading, or having `west` at minimum check that your copy of `zephyr-driver-work-v2` is up to date, you should be poised to add a line to your app&amp;#39;s `prj.conf` file, to enable this sensor.&amp;nbsp; In my driver demo&amp;#39;s prj.conf, the one line which &amp;quot;turns on&amp;quot; and includes all the out-of-tree driver details is:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; CONFIG_KX132_1211=y&lt;/p&gt;
&lt;p&gt;The symbol which I actually wrote in the driver code is `KX132_1211`, but somewhere the actions of, I am guessing, Kconfig language and parser converts my symbol and prepends `CONFIG_` to the beginning of that symbol.&lt;/p&gt;
&lt;p&gt;I think you already have this symbol in a prj.conf or other project config file, otherwise you would not have that &amp;quot;undefined symbol&amp;quot; error.&lt;/p&gt;
&lt;p&gt;On a few occasions this year 2021, I encountered the error &amp;quot;attempting to assign &amp;#39;y&amp;#39; to undefined symbol&amp;quot; when I had failed to reference needed third party repositories in my project manifest file.&amp;nbsp; I am also still trying to wrap my head about the way in which the `west` utility reaches up into the parent directory above my local cloned app repository, and populates the other project dependencies (code repos) there.&amp;nbsp; The top location(s) and hierarchy of `west` workspaces is a little different than I am used to seeing in my prior C based, embedded and other project experiences.&lt;/p&gt;
&lt;p&gt;This reminds me, while you may not need write your own out-of-tree Zephyr device drivers, the following blog post by engineer Jared Wolff has been an excellent resource to me:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; *&amp;nbsp; &lt;a title="Building driver on Zephyr - Jared Wolff" href="https://interrupt.memfault.com/blog/building-drivers-on-zephyr" rel="noopener noreferrer" target="_blank"&gt;https://interrupt.memfault.com/blog/building-drivers-on-zephyr&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I also highly recommend to visit Jared&amp;#39;s technical help forum at &lt;a title="Circuit Dojo community forum" href="https://community.jaredwolff.com/" rel="noopener noreferrer" target="_blank"&gt;https://community.jaredwolff.com/&lt;/a&gt;.&amp;nbsp; Mr. Wolff is knowledgeable, responsive, patient and enthusiastic.&amp;nbsp; All great qualities for an engineer working in these fields and collaborating with other developers and teams.&amp;nbsp; I&amp;#39;ve posted my technical, Zephyr and nRF9160 related questions there on several occasions and always received prompt, useful help.&amp;nbsp; Definitely another technical forum worth visiting!&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF1960 and Out-of-tree Zephyr new driver development?</title><link>https://devzone.nordicsemi.com/thread/345407?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 20:36:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b2308dd-19de-46c0-aa1d-908203b48981</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Pawel,&lt;/p&gt;
&lt;p&gt;Regarding your questions, I was eventually able to solve these problems of header files not found, and a Kconfig symbol I&amp;#39;d created for the KX132-1211 not being defined.&amp;nbsp; I may be able to help.&lt;/p&gt;
&lt;p&gt;First, apologies that I did not return and post my solution, so that Nordic team could close this ticket.&amp;nbsp; The summary solution I can share is that I needed to write a correct `west` manifest file for my Zephyr based app.&lt;/p&gt;
&lt;p&gt;Second, a couple of comments:&amp;nbsp; I&amp;#39;m working in a Linux environment at the command line, and relying regularly on the Python based `west` utility, and cmake and friends.&amp;nbsp; Second comment, forgive me if I state things that are basic or obvious.&amp;nbsp; I don&amp;#39;t mean to underestimate your project. experience.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So I created this tiny app to exercise Kionix driver which I am developing.&amp;nbsp; The `west` manifest file pulls together three git repositories, to form a complete, build-able project.&amp;nbsp; These repositories are Nordic&amp;#39;s &lt;a title="Nordic sdk-nrf v1.6.1 archived code repo" href="https://github.com/nrfconnect/sdk-nrf/releases/tag/v1.6.1" rel="noopener noreferrer" target="_blank"&gt;nrfconnect/sdk-nrf/releases/tag/v1.6.1&lt;/a&gt;, &lt;a title="Zephyr out-of-tree Kionix driver" href="https://github.com/tedhavelka/zephyr-driver-work-v2" rel="noopener noreferrer" target="_blank"&gt;zephyr-driver-work-v2&lt;/a&gt;, and &lt;a title="Zephyr based app to test KX132-1211 driver under development" href="https://github.com/tedhavelka/kionix-driver-demo" rel="noopener noreferrer" target="_blank"&gt;kionix-driver-demo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The third of these repositories is my app.&amp;nbsp; This is the code in which you&amp;#39;ll find `int main()`.&amp;nbsp; I&amp;#39;d seen somewhere this past year among Zephyr RTOS tutorials and how-tos, a recurring theme:&amp;nbsp; &amp;quot;Zephyr projects are app centric&amp;quot;.&amp;nbsp; It has taken me a while to understand this statement.&amp;nbsp; But I&amp;#39;m finding it accurate and true.&amp;nbsp; The simple driver demo above pulls in the much larger coding projects of ncs, and the out-of-tree driver, each of these as code dependencies much like libraries.&amp;nbsp; In this sense my app is my starting point, and the west.yml manifest file is really what makes this so.&lt;/p&gt;
&lt;p&gt;Your starting point naturally is different.&amp;nbsp; I can see this from the path you name, `nrfConnectSDK/v1.8.0/...`.&amp;nbsp; Without knowing more detail about your project, I am curious to know whether your west.yml manifest file references the Kionix driver code at &lt;a title="Zephyr based app to test KX132-1211 driver under development" href="https://github.com/tedhavelka/kionix-driver-demo" rel="noopener noreferrer" target="_blank"&gt;kionix-driver-demo&lt;/a&gt;?&amp;nbsp; If not, this may be part of the reason you&amp;#39;re getting the &amp;quot;no such [header] file or directory&amp;quot; and &amp;quot;attempting to assign &amp;#39;y&amp;#39; to undefined symbol&amp;quot; errors.&lt;/p&gt;
&lt;p&gt;Here is the brief `west` manifest file which I use to build my driver testing app:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;manifest:
  remotes:
    - name: nrfconnect
      url-base: https://github.com/nrfconnect
  projects:
    - name: nrf 
      repo-path: sdk-nrf
      remote: nrfconnect
      revision: v1.6.1
      import: true
    # Drivers repository
    - name: zephyr-driver-work-v2
      path: kionix-drivers
      revision: main
      url: https://github.com/tedhavelka/zephyr-driver-work-v2
#      import: true   ...2021-08-26 for some reason this should be commented out - TMH
  self:
    # This repository should be cloned to 
    path: kionix-driver-demo
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m wondering what happens if you add the lines 11..15 to your app&amp;#39;s west.yml manifest file, and then invoke `west update`.&amp;nbsp; If this works as I expect, you should get a copy of the Kionix out-of-tree driver project, in a directory that&amp;#39;s located at the top dir of your west workspace.&lt;/p&gt;
&lt;p&gt;One other caveat:&amp;nbsp; I have not finished the KX132-1211 driver.&amp;nbsp; I&amp;#39;ve only developed that driver minimally so far, enough to obtain x, y, z axis acceleration readings, and I believe to set output data rate.&amp;nbsp; Does Pinetime Hypnos or another part of your work depend on a complete Kionix KX132-1211 driver?&lt;/p&gt;
&lt;p&gt;I am curious to hear whether any of this helps you resolve your build errors.&amp;nbsp; Keep safe,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF1960 and Out-of-tree Zephyr new driver development?</title><link>https://devzone.nordicsemi.com/thread/345300?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 00:32:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e413bd7-9d9e-48c8-b541-0f229eefc00b</guid><dc:creator>kapollo</dc:creator><description>&lt;p&gt;Hi guys I&amp;#39;ve been trying to build the drive that Ted mentioned, I assume it&amp;#39;s already patched/changed, well the problem is I can&amp;#39;t build it...&lt;br /&gt;I get :&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;nrfConnectSDK/v1.8.0/nRF9160-work/nRF9160-work-main/kionix-work/app/src/main.c:17:10: fatal error: kx132-1211.h: No such file or directory&lt;br /&gt;&amp;nbsp;&amp;nbsp; 17 | #include &amp;quot;kx132-1211.h&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^~~~~~~~~~~~~~&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The main reason I came here is that I get similar problems (to the original problem Ted had with the:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt; attempt to assign the value &amp;#39;y&amp;#39; to the undefined symbol&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to build &lt;a href="https://github.com/albsod/pinetime-hypnos"&gt;pinetime hypnos&lt;/a&gt; with ncs, and it doesn&amp;#39;t work apart form other problems I have/had I cannot move over this one. So I guessed I will try to find something that actually works (I&amp;#39;ve already established that for some reason Kconfig is part of the problem) under ncs.&lt;br /&gt;As I&amp;#39;ve researched over the Internet it seems its some kind of generic problem people have with out of tree or local drivers&amp;nbsp; directory, all methods, guidelines are mostly it seems for pure Zephyr, not for creations like ncs.&lt;/p&gt;
&lt;p&gt;So to build &lt;a href="https://github.com/tedhavelka/nRF9160-work/tree/main/kionix-work/drivers/kionix"&gt;this &lt;/a&gt;repo from Ted&amp;#39;s github I&amp;#39;m using Windows with ncs&amp;nbsp; (1.8.0) installed with toolchain manager. &lt;br /&gt;I put Ted&amp;#39;s repo into main 1.8.0 and then under bash (opened from toolchain manager) &lt;br /&gt;I call :&lt;br /&gt;west build -b nrf9160dk_nrf9160_ns kionix-work/app&lt;/p&gt;
&lt;p&gt;and it ends up with the error like pasted above.&lt;/p&gt;
&lt;p&gt;I have some experience with ncs, but all I&amp;#39;ve been doing was fairly simple, not touching custom drivers presented in this very fashion (as out of tree driver), nor had to touch Zephyr&amp;#39;s build system that much.&lt;/p&gt;
&lt;p&gt;Now I guess that since the error is about not finding the include file (and I assume that if everything is setup correctly it should be just picked up like that) there is still some kind &amp;quot;wrongness&amp;quot; there (or change in ncs/Zephyr).&lt;/p&gt;
&lt;p&gt;I would be grateful if someone could tell me how to exactly build it under ncs (it should help me move forward with hypnos I believe)&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;br /&gt;Pawel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF1960 and Out-of-tree Zephyr new driver development?</title><link>https://devzone.nordicsemi.com/thread/326417?ContentTypeID=1</link><pubDate>Tue, 24 Aug 2021 17:26:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec767735-e04a-4cb0-8eae-590bf6c4002b</guid><dc:creator>Sigurd</dc:creator><description>[quote user="tedhavelka"] I&amp;#39;ve applied the patch you sent, and achieved an error-free compilation on my local workstation&amp;#39;s experimental kionix code repo.[/quote]
&lt;p&gt;&amp;nbsp;Great&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
[quote user="tedhavelka"]Somewhere in the Zephyr build toolchain, a _CONCAT_ macro receives a NULL parameter, so a comlete device symbol cannot be properly generated.[/quote]
&lt;p&gt;Could be that the board overlay you had is not being applied (correctly) for the board you are building for.&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 *  https://community.jaredwolff.com/d/73-accelerometer-example-failing-to-compile-on-feather-v2/2
 *  https://www.youtube.com/watch?v=sWaxQyIgEBY  --- Device Tree Deep Dive
 */

&amp;amp;i2c1 {
        compatible = &amp;quot;nordic,nrf-twim&amp;quot;;
        status = &amp;quot;okay&amp;quot;;
        sda-pin = &amp;lt;26&amp;gt;;
        scl-pin = &amp;lt;27&amp;gt;;
        kionix_sensor: kx132-1211@1f {
                compatible = &amp;quot;kionix,kx132-1211&amp;quot;; 
                reg = &amp;lt;0x1F&amp;gt;;
                label = &amp;quot;KX132-1211&amp;quot;;
        };  
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF1960 and Out-of-tree Zephyr new driver development?</title><link>https://devzone.nordicsemi.com/thread/326415?ContentTypeID=1</link><pubDate>Tue, 24 Aug 2021 17:00:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3aea9c28-5d7d-4e53-a55d-6af11c1aa32b</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Thank you Sigurd,&lt;/p&gt;
&lt;p&gt;The links you have sent regarding Zephyr UART driver example and related materials, plus the diff.patch file are turning out helpful.&amp;nbsp; I&amp;#39;ve applied the patch you sent, and achieved an error-free compilation on my local workstation&amp;#39;s experimental kionix code repo.&amp;nbsp; I pushed those diffs to Github, then cloned the same project to a distinct place on my workstation.&lt;/p&gt;
&lt;p&gt;In this `git push; git clone` test, the build in the newly cloned kionix project failed at a much later stage.&amp;nbsp; I don&amp;#39;t have the exact message on hand, but that message appears to regard a device symbol that&amp;#39;s missing an element.&amp;nbsp; Somewhere in the Zephyr build toolchain, a _CONCAT_ macro receives a NULL parameter, so a comlete device symbol cannot be properly generated.&amp;nbsp; I&amp;#39;m looking into this now.&amp;nbsp; I&amp;#39;d seen this before when I&amp;#39;d gotten an &amp;#39;include file&amp;#39; line incorrect in a CMakeLists.txt file.&lt;/p&gt;
&lt;p&gt;The original project instance where I first patched is still building.&amp;nbsp; I&amp;#39;m now making a file by file comparison between this and the newly cloned project.&amp;nbsp; The difference must be something in a git controlled file, as you corrected my code based on what you found on github.&lt;/p&gt;
&lt;p&gt;Also I observe that your patch amends two or three Kconfig files.&amp;nbsp; I&amp;#39;m reviewing your corrections closely to understand the modified syntax.&lt;/p&gt;
&lt;p&gt;Thank you again, Sigurd.&amp;nbsp; I am looking forward to grasping cmake and Kconfig better soon.&amp;nbsp; I will keep yourself and DevZone community posted as to my progress.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF1960 and Out-of-tree Zephyr new driver development?</title><link>https://devzone.nordicsemi.com/thread/326244?ContentTypeID=1</link><pubDate>Mon, 23 Aug 2021 17:35:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36480a1d-ec60-440a-8414-98d6a2d03df8</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You might find this useful:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/peripherals/posts/writing-device-drivers-for-uart-peripherals"&gt;https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/peripherals/posts/writing-device-drivers-for-uart-peripherals&lt;/a&gt;&lt;br /&gt;&lt;a href="https://github.com/Riphiphip/zephyr-uart-driver-example"&gt;https://github.com/Riphiphip/zephyr-uart-driver-example&lt;br /&gt;&lt;br /&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/drivers/index.html#device-driver-model&lt;br /&gt;https://docs.zephyrproject.org/latest/reference/peripherals/sensor.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Is this your driver?&amp;nbsp;&lt;a href="https://github.com/tedhavelka/nRF9160-work/tree/main/kionix-work/drivers/kionix"&gt;https://github.com/tedhavelka/nRF9160-work/tree/main/kionix-work/drivers/kionix&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I got it to compile with this change:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Attachment&lt;/strong&gt;:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/diff.patch"&gt;devzone.nordicsemi.com/.../diff.patch&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF1960 and Out-of-tree Zephyr new driver development?</title><link>https://devzone.nordicsemi.com/thread/326033?ContentTypeID=1</link><pubDate>Sat, 21 Aug 2021 04:46:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c708608-39f4-4930-a25a-ed3bbb83a43c</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Correction:&amp;nbsp; where I write &amp;quot;in-tree work&amp;quot; I intended to say &amp;quot;out-of-tree work&amp;quot;.&amp;nbsp; Second, in my request for an out of tree driver example, I specifically need one which compiles correctly.&amp;nbsp; I have yet to locate a build-able example &amp;quot;out of Zephyr tree&amp;quot; driver with app to demonstrate the driver.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>