<?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>How to create a custom yaml file</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98006/how-to-create-a-custom-yaml-file</link><description>I&amp;#39;m trying to initialize an Analog Devices sensor when I used the &amp;quot;adi,adx1345.yaml&amp;quot; as the configuration even though it&amp;#39;s not the adx1345. ( Previous ticket here ) It did build, yet the sensor doesn&amp;#39;t respond on the MISO bus. I think it is due to the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Apr 2023 19:50:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98006/how-to-create-a-custom-yaml-file" /><item><title>RE: How to create a custom yaml file</title><link>https://devzone.nordicsemi.com/thread/419501?ContentTypeID=1</link><pubDate>Mon, 10 Apr 2023 19:50:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c5fba41-444d-47be-8bc1-6de2b3bdcbc1</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Meh,&lt;/p&gt;
&lt;p&gt;While I don&amp;#39;t fully understand your solution I&amp;#39;m glad you solved your SPI YAML problem.&amp;nbsp; No worries about a response some days out.&amp;nbsp; As the developer posting the issue to solve it&amp;#39;s up to you when and whether to reply.&lt;/p&gt;
&lt;p&gt;Good luck to you in your next stages of firmware development!&amp;nbsp; Stay safe,&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create a custom yaml file</title><link>https://devzone.nordicsemi.com/thread/419264?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 12:26:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1511c442-ae92-4a34-8df7-73f652d24adf</guid><dc:creator>Meh</dc:creator><description>&lt;p&gt;Hey, sorry for the late response.&lt;/p&gt;
&lt;p&gt;However, in my case - using one of the adi&amp;#39;s yamls did the trick eventually - when I looked at the definition, I realized it&amp;#39;s pretty agnostic as it is.&lt;/p&gt;
&lt;p&gt;Thanks for all the helpers :) &lt;a href="https://devzone.nordicsemi.com/members/tedhavelka"&gt;tedhavelka&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create a custom yaml file</title><link>https://devzone.nordicsemi.com/thread/416934?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 21:55:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf0ca30f-3255-471c-a597-af08481b63d8</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/meh"&gt;Meh&lt;/a&gt; you say &amp;quot;the firmware builds well&amp;quot; but that you&amp;#39;re getting errors &amp;quot;in the same format as the previous ticket&amp;quot;.&amp;nbsp; The errors in your previous ticket are compiler errors.&amp;nbsp; So is the firmware actually building, or are your errors happening at run time?&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re finding unexpected run time behavior, are you able to probe SPI bus lines with an oscilloscope or Saleae type probe?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m going to take it that your custom app is erring out at compile time, but an Arduino SPI port / sample app builds correctly.&lt;/p&gt;
&lt;p&gt;In the case that you&amp;#39;re seeing those `DT_N_S_SOC_S_SPI_ . . . not declared here` errors for a SPI-bus-connected sensor, I would double check your bindings file(s) for this sensor.&amp;nbsp; &lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/bindings/spi/spi-device.yaml" rel="noopener noreferrer" target="_blank"&gt;Zephyr RTOS spi-device.yaml&lt;/a&gt; describes four node properties, but says that only `reg` and `spi-max-frequency` are required.&amp;nbsp; Your error messages from the prior ticket indicate to me that your sensor -- if the AFE sensor code throws same compiler errrors -- expects SPI&amp;#39;s `duplex` and `frame-format` node properties to be called out in your overlay or other project DTS files, even if they&amp;#39;re not required properties per Zephyr&amp;#39;s generic SPI device bindings file.&lt;/p&gt;
&lt;p&gt;Are you able to open up your project&amp;#39;s build artifacts?&amp;nbsp; If you&amp;#39;re building a Zephyr based app for a single core microcontroller, you should be able to find some useful summary info in an intermediate build file in [application_root]/build/zephyr/zephyr.dts.&amp;nbsp; You may already know this, but this file holds the final summary and &amp;quot;winning selections&amp;quot; of all the parsed device tree source in your app&amp;#39;s project.&amp;nbsp; I have tracked down a number of bugs and incorrect device tree property settings by reviewing this file as I build and develop new features.&lt;/p&gt;
&lt;p&gt;It appears that you&amp;#39;re already writing your own bindings and device tree files.&amp;nbsp; In your project I would double check that the overlay file for the AFE sensor contains correctly formatted, and correctly assigned node properties for your AFE.&amp;nbsp; If the node property such as `duplex` appears in your AFE&amp;#39;s device tree node in `[application_root]/build/zephyr/zephyr.dts` then there should be no error of the form `DT_N_S_SOC_S_SPI_ . . . not declared here` for that particular node property.&lt;/p&gt;
&lt;p&gt;Some of the comments in Zephyr RTOS&amp;#39; general SPI device bindings file linked to in this reply, mention that properties like `frame-format` should be assigned a macro for their value, rather than the numeric values to which those properties can be set.&amp;nbsp; To better understand how vendors author their sensor overlay files, I find some reasonable DTS overlays by searching Zephyr&amp;#39;s source tree starting at `zephyr/samples`.&amp;nbsp; My text search pattern (grep -nr spi-max-freqency ./*) returns almost twenty overlay files.&amp;nbsp; A dozen of these live in `zephyr/samples/drivers`.&amp;nbsp; And I can see some of them call out and assign values to optional, and not just required SPI bindings properties.&lt;/p&gt;
&lt;p&gt;This reply does not solve your problem but I would be curious to see what that zephyr.dts file contains for the AFE device node.&amp;nbsp; If your build process errors out before this file is generated, I expect you can at least get a little further by adding any missing node properties to your overlay, those which appear one per line in the errors at the top of your previous ticket.&amp;nbsp; Their assigned values could be wrong, but if the DTS syntax is correct then the device tree compiler should generate those missing, &amp;quot;not declared&amp;quot; symbols.&lt;/p&gt;
&lt;p&gt;Once you overcome those &amp;quot;not declared&amp;quot; errors, the values to assign the declared properties should be presented in the datasheet of your AFE, in a section about SPI or digital interfacing of that part.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create a custom yaml file</title><link>https://devzone.nordicsemi.com/thread/416920?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 20:37:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:740d0919-4bf3-4260-8723-4f3c6322f75e</guid><dc:creator>Meh</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/tedhavelka"&gt;tedhavelka&lt;/a&gt;&amp;nbsp; My sensor is not an accelerometer but rather a certain AFE. I&amp;#39;m getting errors in the same format as the previous ticket but with different fields as issues - A misconfigured node property.&lt;/p&gt;
&lt;p&gt;To start with something stable, I&amp;#39;ve already used the &amp;quot;Arduino SPI&amp;quot; port - with CS defined. The funny part is - the firmware builds well. I&amp;#39;m clueless.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create a custom yaml file</title><link>https://devzone.nordicsemi.com/thread/416905?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 17:40:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:647c65cc-e60e-4b34-832d-a9dcd67eee76</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Meh,&lt;/p&gt;
&lt;p&gt;To your question and post here regarding a SPI based sensor -- I assume an accelerometer? -- will you share the specific build time errors you&amp;#39;re seeing?&amp;nbsp; I don&amp;#39;t find those in your code excerpt of thirteen lines above.&amp;nbsp; Those specific errors could be most helpful.&lt;/p&gt;
&lt;p&gt;Are you able to share the part number of the sensor you&amp;#39;re bringing up?&amp;nbsp; I have read your prior ticket but I don&amp;#39;t see a specific sensor mentioned there.&amp;nbsp; Might help in trouble-shooting to know this, even if the issue you&amp;#39;re facing is not ultimately sensor specific.&lt;/p&gt;
&lt;p&gt;Recently I was working and able to bring up a Kionix accelerometer on a SPI bus, in a Zephyr based application.&amp;nbsp; For this my work depends on device tree source and YAML bindings files.&amp;nbsp; While not an expert, there may be some help I can offer you based on some of the problems I faced and had to overcome.&lt;/p&gt;
&lt;p&gt;One strange thing I noticed is that despite Zephyr RTOS sensor API and conventions, I needed in my application to declare and initialize a GPIO outside of the sensor driver code, to provide for the chip select signal to my sensor.&amp;nbsp; It was not sufficient to have a `drdy-gpios` or `cs-gpios` property in sensor node of my application&amp;#39;s DTS overlay file.&amp;nbsp; That alone did not generate a working CS line.&amp;nbsp; But it sounds like you are facing errors at an earlier-than-run-time stage.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>