<?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>Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution</link><description>I can see in Segger Embedded Studio v4.52 under the Build Tab, there are two methods to build the project. 
 1- Build &amp;gt; Build zephyr/zephyr.elf 
 2- Build &amp;gt; Build solution 
 
 What is the difference between the two methods? 
 Kind regards</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 30 Oct 2020 13:10:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution" /><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/277815?ContentTypeID=1</link><pubDate>Fri, 30 Oct 2020 13:10:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f17307e-87d1-4573-a1a0-54cfe4ffb9bd</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Yes, there is a west.yml file in the &amp;quot;zephyr&amp;quot; directory as well and you can run west update there. However, the &amp;quot;west.yml&amp;quot; file in nrf is the one that describes what NCS environment the sample is written in, because that&amp;#39;s the west.yml file that comes from&amp;nbsp;&lt;a href="https://github.com/pabigot/fw-nrfconnect-nrf/tree/sample/20201020a"&gt;the repository&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/277629?ContentTypeID=1</link><pubDate>Thu, 29 Oct 2020 14:14:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abebf6e9-166f-4057-8815-116fdc2ba4ac</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Thank you Heidi. I understand.&lt;/p&gt;
&lt;p&gt;Just in case I did not mention it before, I am using nRF5340 SoC under zephyr RTOS. So, I have two west.yml files. one under &lt;strong&gt;C:\Zypher\v1.3.0\nrf&lt;/strong&gt; and another one under&amp;nbsp;&lt;strong&gt;C:\Zypher\v1.3.0\zephyr&lt;/strong&gt;. So, I think I should be running west update from&amp;nbsp;&lt;strong&gt;C:\Zypher\v1.3.0\zephyr&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;What do you think?&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/277612?ContentTypeID=1</link><pubDate>Thu, 29 Oct 2020 13:27:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2667db1-7262-47f6-9eda-4fab23d9e885</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Learner"]Why can&amp;#39;t I do that?[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can, it&amp;#39;s just that some changes might be needed. If you want to guarantee it works out of the box, you should use the NCS environment it&amp;#39;s written in. But, just try to build and run and see how that goes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You should run west update in the folder that contains the &amp;quot;west.yml&amp;quot; file, so ncs/nrf. This will update all the repositories in the NCS folder (so zephyr, mcuboot, bootloader, nrfxlib, etc)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/277055?ContentTypeID=1</link><pubDate>Tue, 27 Oct 2020 09:07:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75854b6a-8e08-4f30-b8f8-0bf358999c18</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Thank you Heidi,&lt;/p&gt;
[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/277033#277033"]Make sure to use the ncs environment the sample was made in (so don&amp;#39;t extract the sample folder and place it in another ncs tag) [/quote]
&lt;p&gt;I was going to extract only the sample I was interested in (&lt;a href="https://github.com/pabigot/fw-nrfconnect-nrf/blob/sample/20201020a/samples/myapp/)"&gt;https://github.com/pabigot/fw-nrfconnect-nrf/blob/sample/20201020a/samples/myapp/)&lt;/a&gt; and run it in my current environment. Why can&amp;#39;t I do that?&lt;/p&gt;
&lt;p&gt;I have my current zephyr installation here C:\Zypher\v1.3.0\...&amp;nbsp;&lt;/p&gt;
&lt;p&gt;06/08/2020 14:04 &amp;lt;DIR&amp;gt; .&lt;br /&gt;06/08/2020 14:04 &amp;lt;DIR&amp;gt; ..&lt;br /&gt;29/07/2020 17:21 &amp;lt;DIR&amp;gt; .west&lt;br /&gt;29/07/2020 17:25 &amp;lt;DIR&amp;gt; bootloader&lt;br /&gt;05/08/2020 11:38 1,664 Go_west.bat&lt;br /&gt;29/07/2020 17:26 &amp;lt;DIR&amp;gt; mbedtls&lt;br /&gt;29/07/2020 17:29 &amp;lt;DIR&amp;gt; modules&lt;br /&gt;29/07/2020 17:21 &amp;lt;DIR&amp;gt; nrf&lt;br /&gt;29/07/2020 17:25 &amp;lt;DIR&amp;gt; nrfxlib&lt;br /&gt;29/07/2020 17:25 &amp;lt;DIR&amp;gt; test&lt;br /&gt;29/07/2020 17:21 &amp;lt;DIR&amp;gt; toolchain&lt;br /&gt;29/07/2020 17:29 &amp;lt;DIR&amp;gt; tools&lt;br /&gt;29/07/2020 17:39 &amp;lt;DIR&amp;gt; zephyr&lt;/p&gt;
[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/277033#277033"]make sure to run west update, to update the other repositories as well.[/quote]
&lt;p&gt;Which folder should I run the command &amp;#39;west update&amp;#39; from?&lt;/p&gt;
&lt;p&gt;Which other repositories&amp;nbsp;will it update?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/277033?ContentTypeID=1</link><pubDate>Tue, 27 Oct 2020 08:11:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e62e411e-c10c-41b4-ba72-aa2a4e8d04ec</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;&lt;a href="https://github.com/pabigot/fw-nrfconnect-nrf/tree/sample/20201020a"&gt;Here&lt;/a&gt;&amp;nbsp;there is a green button called &amp;quot;Code&amp;quot;. You can hit &amp;quot;Download&amp;quot; zip to get the zip-file or run git clone&amp;nbsp;&lt;a href="https://github.com/pabigot/fw-nrfconnect-nrf.git"&gt;https://github.com/pabigot/fw-nrfconnect-nrf.git &lt;/a&gt;to clone the git repository.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Make sure to use the ncs environment the sample was made in (so don&amp;#39;t extract the sample folder and place it in another ncs tag) and make sure to run west update, to update the other repositories as well.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276948?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 15:38:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d70fca5c-a124-47d5-9f4e-b9eab25e7660</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Heidi,&lt;/p&gt;
&lt;p&gt;Your developer has actually provided a binding specific to our needs. So, I do not have to create my own bindings :). Happy days!&lt;/p&gt;
&lt;p&gt;How do I download the code for the sample?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276640?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 13:15:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68800dfa-2906-400c-af6e-abd1db07b494</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi! I can try to summarize the most important parts of this very long thread in this comment. :)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To set up the ADC peripheral as IO-channels in the overlay file, we need to create a new node under the root node like this:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
    my,node {
        compatible = &amp;quot; &amp;quot;;
        io-channels = &amp;lt;&amp;amp;adc 0&amp;gt;, &amp;lt;&amp;amp;adc 1&amp;gt;;
        io-channel-names = &amp;quot;CHANNEL_0_LABEL&amp;quot;, &amp;quot;CHANNEL_1_LABEL&amp;quot;;
    };
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;where the &amp;amp;adc node is now connected with the analog input channels 0 and 1. Please note that you still need to configure the actual analog inputs (AIN0 to AIN7) in the main file. You can configure any analog input to any analog input channel.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;All nodes need a &amp;quot;compatible&amp;quot; property. Even though it may seem like a logical choice for this node, you cannot use &amp;quot;nordic,nrf-saadc&amp;quot; as the compatible. This is a binding written specifically to instantiate the ADC peripheral and cannot be used with a node.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The only one available in NCS as of now is the &amp;quot;voltage-divider&amp;quot; binding in zephyr/dts/bindings/iio/adc/voltage-divider.yaml.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Users can create their own bindings and then use this as the&amp;nbsp;compatible property. See the Zephyr Bindings documentation before you start writing it, for the file syntax and conventions, etc. Make sure to use a `[compatible]` that&amp;#39;s namespaced to avoid conflict with other devicetree node identifiers; use something like `[companyname,rc-divider]`.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The &amp;amp;adc node does not need to be defined or set to status = &amp;quot;okay&amp;quot;, because both of these things are taken care of in the board folder.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One of our developers wrote a simple sample for your use case (RC-divider and OP-AMP) that can be found &lt;a href="https://github.com/pabigot/fw-nrfconnect-nrf/blob/sample/20201020a/samples/myapp/"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, please note that the documentation for the pin mapping on the nRF5340 PDK has some errors (both in the Getting Started guide and on the actual board).&lt;/p&gt;
&lt;p&gt;This is the correct mapping, and on the nRF5340 PDK, the front of the board has the correct labels for the GPIO pins.&amp;nbsp;&lt;/p&gt;
&lt;table height="151" width="175"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AIN0&lt;/td&gt;
&lt;td&gt;P0.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN1&lt;/td&gt;
&lt;td&gt;P0.05&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN2&lt;/td&gt;
&lt;td&gt;P0.06&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN3&lt;/td&gt;
&lt;td&gt;P0.07&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN4&lt;/td&gt;
&lt;td&gt;P0.25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN5&lt;/td&gt;
&lt;td&gt;P0.26&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN6&lt;/td&gt;
&lt;td&gt;P0.27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN7&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;P0.28&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As for the unit-address with regard to the SPI peripheral, it is defined as:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;An index representing the peripheral’s chip select line number. (If there is no chip select line, 0 is used.)&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Using &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.3.0-rc1-ncs2/include/devicetree/spi.h#L84-L105"&gt;this example&lt;/a&gt; as the explanation: The&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;spi1&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;node has a&lt;span&gt;&amp;nbsp;chip select (&lt;/span&gt;&lt;span&gt;cs-gpios)&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;property, which means that the unit addresses for node&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;a&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;and&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;b&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;(0 and 1 respectively) are indexes into the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;cs-gpios&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;array (&lt;em&gt;an index representing the peripheral&amp;#39;s chip select line number&lt;/em&gt;). The&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;spi1&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;node has no&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;cs-gpios&lt;/span&gt;, so node&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;c&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;has no chip select configured in the device tree, and therefore its unit address is left at 0 (&lt;em&gt;if there is no chip select line, 0 is used)&lt;/em&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This might seem&amp;nbsp;a bit&amp;nbsp;confusing, but you cannot look at the unit-addresses of nodes alone, you always have to look at the unit-address in context to the parent node. And when you look at the parent node of sub-node a versus sub-node c it becomes clear that sub-node a&amp;#39;s &amp;quot;0&amp;quot; means an index into the cs-gpios array and sub-node c&amp;#39;s &amp;quot;0&amp;quot; is just &amp;quot;NULL&amp;quot;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let me know if there&amp;#39;s anything missing and I&amp;#39;ll add it in!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also thank you for all your questions!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Heidi&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276589?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 09:37:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d1f99d0-6358-49b3-a79f-749ff8ebe8f8</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Thank you Heidi.&lt;/p&gt;
&lt;p&gt;I would like to &amp;#39;Verify Answer&amp;#39; but there bits bits of information spread over multiple&amp;nbsp;posts. One way to do this would be to add&amp;nbsp;the bits of missing information to the post that has most of the correct info. Please let me know and I will Verify.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276425?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 11:41:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd0d2072-58a8-4870-8753-8b36264d72cf</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Yes absolutely! I have changed it now. :)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276414?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 10:58:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:004c2680-300b-4f02-af48-58e99f23ee94</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Heidi,&lt;/p&gt;
&lt;p&gt;Thank you. It is much clearer now.&lt;/p&gt;
&lt;p&gt;p_reg-&amp;gt;CH[channel].PSELP = pselp;&lt;/p&gt;
&lt;p&gt;where &lt;br /&gt;NRF_SAADC_Type * p_reg = NRF_SAADC&lt;br /&gt;uint8_t channel = ADC_1ST_CHANNEL_ID&lt;br /&gt;nrf_saadc_input_t pselp = &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ADC_1ST_CHANNEL_ID&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I think you meant to say &lt;strong&gt;nrf_saadc_input_t pselp = ADC_1ST_CHANNEL_INPUT&lt;/strong&gt;. Right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276404?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 10:24:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5df891dd-c6fa-4f56-a436-3b2f8bc5a418</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Heidi,&lt;/p&gt;
[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/276309#276309"]Did it work with the analog device plugged into GPIO pin 28 or pin 6?[/quote]
&lt;p&gt;Apologies, it was NOT P0.28 that I am connecting the pot to but P0.06.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason I got confused is because the labelling on the top and bottom&amp;nbsp;of the nRF5340pdk board is different. I looked on the bottom side where the pot was soldered on and there it says &lt;strong&gt;P0.28 (A2)&lt;/strong&gt;. This morning, by accident, I was looking at the&amp;nbsp;top of the pdk board and noticed there was a pin labelled P0.06 which also happens to be the pin the pot is connected to. So, I think P0.28 (A2) is for another board not the nRF5340PDK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276403?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 10:21:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02376dd0-db08-4b93-9eaf-0d8eb0a65c17</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So&amp;nbsp;according to&amp;nbsp;the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf5340%2Fsaadc.html&amp;amp;cp=3_0_0_6_28_3&amp;amp;anchor=saadc_inputs"&gt;analog inputs and channels&amp;nbsp;page&lt;/a&gt;&amp;nbsp;for the nRF5340, there are eight analog input &lt;em&gt;channels&lt;/em&gt; that can be configured CH[n] (n=0, 1, .., 7).&lt;/p&gt;
&lt;p&gt;There are also eight analog inputs available (AIN0, AIN1, ... AIN7) and VDD and VDDHDIV5.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So the channel_id refers to one of the eight analog input&amp;nbsp;&lt;em&gt;channels&lt;/em&gt; and the channel_input refers to an analog input. That is the difference.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There are 8 identical analog input channels and you can use whichever one you want and you can configure that channel with any analog input you&amp;nbsp;want. They are not &amp;quot;connected&amp;quot; as I initially thought, where channel 0 uses AIN0 and so forth.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If it helps you understand better, here is how the channel_id is used in the code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So the function&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/drivers/adc/adc_nrfx_saadc.c#L31"&gt;adc_nrfx_channel_setup&lt;/a&gt;(const struct device *dev, const struct adc_channel_cfg *channel_cfg)&lt;br /&gt;is called, where channel_id is one of the properties in the adc_channel_cfg struct.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then, in this function, the channel_id is passed to &lt;a href="https://github.com/nrfconnect/sdk-hal_nordic/blob/master/nrfx/hal/nrf_saadc.h#L850"&gt;nrf_saadc_channel_init&lt;/a&gt;(), &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/drivers/adc/adc_nrfx_saadc.c#L120"&gt;here&lt;/a&gt;. If you take a look at the function definition,&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span&gt;you can see the channel ID is being used the select the correct CH[n].CONFIG register to add all the configurations.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;p_reg-&amp;gt;CH[channel].CONFIG =&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The positive input isn&amp;#39;t set until the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/drivers/adc/adc_nrfx_saadc.c#L256"&gt;start_read()&lt;/a&gt;&amp;nbsp;function is called. Then the function &lt;a href="https://github.com/nrfconnect/sdk-hal_nordic/blob/master/nrfx/hal/nrf_saadc.h#L715"&gt;nrf_saadc_channel_pos_input_set&lt;/a&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/drivers/adc/adc_nrfx_saadc.c#L302"&gt;()&lt;/a&gt;&amp;nbsp;is called &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/drivers/adc/adc_nrfx_saadc.c#L302"&gt;here&lt;/a&gt;. If we take a look at this function definition:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;p_reg-&amp;gt;CH[channel].PSELP = pselp;

where 
NRF_SAADC_Type * p_reg = NRF_SAADC
uint8_t channel = ADC_1ST_CHANNEL_ID
nrf_saadc_input_t pselp = ADC_1ST_CHANNEL_INPUT&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;we can see that it uses the channel ID to&amp;nbsp;the specific channel to be associated with the analog input passed to the function (ADC_1ST_CHANNEL_ID).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So for instance you can set NRFSAADC-&amp;gt;CH[0].PSELP = &lt;span&gt;NRF_SAADC_INPUT_AIN7 without a problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="Learner"] If as you said it is &lt;strong&gt;ADC_1ST_CHANNEL_INPUT&lt;/strong&gt;&amp;nbsp;then&amp;nbsp;why is &lt;strong&gt;ADC_1ST_CHANNEL_ID &lt;/strong&gt;needed?[/quote]
&lt;p&gt;&amp;nbsp;So to answer this question it&amp;#39;s because the channel ID specifies which of the analog input channels you are referring to and is used with the register CH[channel_id].PSELP and CH[channel_id].CONFIG. And the channel input defines which analog input to &amp;quot;attach&amp;quot; to that channel.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So CH[CHANNEL_ID].PSELP = CHANNEL_INPUT.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Learner"] So, it seems that for the nRF5340PDK the values used for&amp;nbsp;&lt;span&gt;ADC_1ST_CHANNEL_ID&amp;nbsp; and&amp;nbsp;ADC_1ST_CHANNEL_INPUT&amp;nbsp;must the same. Any&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;No, they do not need to be the same. You do however need to be connected to the correct GPIO pin.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Learner"]So, I looked closely to pin P0.28 on the back of the pdk board and realised that P0.28 is actually labelled &lt;strong&gt;(A2)&lt;/strong&gt;[/quote]
&lt;p&gt;&amp;nbsp;Those labels are just the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf5340_pdk/UG/nrf5340_PDK/hw_analog_pins.html"&gt;arduino naming&lt;/a&gt;&amp;nbsp;and don&amp;#39;t correspond to the analog inputs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It also looks like the printing on back of the board and the front of the board don&amp;#39;t match up.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The front of the board has the correct labeling, so if you are plugged into the pin with the P0.08 label on the back, you are actually connected to P0.06 which is AIN2. So at least that mystery is solved!&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="194" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/3005.cropped_5F00_back.png" width="217" /&gt;&lt;img alt=" " height="197" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/2018.cropped_5F00_front.png" width="176" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, on the nRF5340 PDK GPIO P0.28 (AIN7) is also used for LED1. To be able to use AIN7, you will need to cut SB5 on the board, see &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf5340_pdk/UG/nrf5340_PDK/solder_bridge.html"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276317?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 22:32:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e73266c9-e5a6-4256-ac2f-6fb98d64fe49</guid><dc:creator>Learner</dc:creator><description>[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/276309#276309"]Did it work with the analog device plugged into GPIO pin 28 or pin 6?[/quote]
&lt;p&gt;It was pin P0.28. I could not insert the dts file as attachment, so, I am pasting its content instead.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/dts-v1/;

/ {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x1 &amp;gt;;
model = &amp;quot;Nordic NRF5340 PDK NRF5340 Application&amp;quot;;
compatible = &amp;quot;nordic,nrf5340-pdk-nrf5340-cpuapp&amp;quot;, &amp;quot;nordic,nrf5340-cpuapp-qkaa&amp;quot;, &amp;quot;nordic,nrf5340-cpuapp&amp;quot;;
chosen {
zephyr,flash-controller = &amp;amp;flash_controller;
zephyr,console = &amp;amp;uart0;
zephyr,shell-uart = &amp;amp;uart0;
zephyr,uart-mcumgr = &amp;amp;uart0;
zephyr,bt-mon-uart = &amp;amp;uart0;
zephyr,bt-c2h-uart = &amp;amp;uart0;
zephyr,ipc_shm = &amp;amp;sram0_shared;
zephyr,sram = &amp;amp;sram0_image;
zephyr,flash = &amp;amp;flash0;
zephyr,code-partition = &amp;amp;slot0_partition;
zephyr,sram-secure-partition = &amp;amp;sram0_s;
zephyr,sram-non-secure-partition = &amp;amp;sram0_ns;
};
aliases {
flash-controller = &amp;amp;flash_controller;
rtc-0 = &amp;amp;rtc0;
rtc-1 = &amp;amp;rtc1;
uart-0 = &amp;amp;uart0;
uart-1 = &amp;amp;uart1;
uart-2 = &amp;amp;uart2;
uart-3 = &amp;amp;uart3;
adc-0 = &amp;amp;adc;
egu-0 = &amp;amp;egu0;
egu-1 = &amp;amp;egu1;
egu-2 = &amp;amp;egu2;
egu-3 = &amp;amp;egu3;
egu-4 = &amp;amp;egu4;
egu-5 = &amp;amp;egu5;
gpio-0 = &amp;amp;gpio0;
gpio-1 = &amp;amp;gpio1;
gpiote-0 = &amp;amp;gpiote;
i2c-0 = &amp;amp;i2c0;
i2c-1 = &amp;amp;i2c1;
i2c-2 = &amp;amp;i2c2;
i2c-3 = &amp;amp;i2c3;
ipc-0 = &amp;amp;ipc;
pdm-0 = &amp;amp;pdm0;
spi-0 = &amp;amp;spi0;
spi-1 = &amp;amp;spi1;
spi-2 = &amp;amp;spi2;
spi-3 = &amp;amp;spi3;
spi-4 = &amp;amp;spi4;
pwm-0 = &amp;amp;pwm0;
pwm-1 = &amp;amp;pwm1;
pwm-2 = &amp;amp;pwm2;
pwm-3 = &amp;amp;pwm3;
wdt-0 = &amp;amp;wdt;
timer-0 = &amp;amp;timer0;
timer-1 = &amp;amp;timer1;
timer-2 = &amp;amp;timer2;
led0 = &amp;amp;led0;
led1 = &amp;amp;led1;
led2 = &amp;amp;led2;
led3 = &amp;amp;led3;
sw0 = &amp;amp;button0;
sw1 = &amp;amp;button1;
sw2 = &amp;amp;button2;
sw3 = &amp;amp;button3;
};
soc {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x1 &amp;gt;;
compatible = &amp;quot;nordic,nRF5340-CPU0-QKAA&amp;quot;, &amp;quot;nordic,nRF5340-CPU0&amp;quot;, &amp;quot;nordic,nRF53&amp;quot;, &amp;quot;simple-bus&amp;quot;;
interrupt-parent = &amp;lt; &amp;amp;nvic &amp;gt;;
ranges;
nvic: interrupt-controller@e000e100 {
compatible = &amp;quot;arm,v8m-nvic&amp;quot;;
reg = &amp;lt; 0xe000e100 0xc00 &amp;gt;;
interrupt-controller;
#interrupt-cells = &amp;lt; 0x2 &amp;gt;;
arm,num-irq-priority-bits = &amp;lt; 0x3 &amp;gt;;
phandle = &amp;lt; 0x1 &amp;gt;;
};
systick: timer@e000e010 {
compatible = &amp;quot;arm,armv8m-systick&amp;quot;;
reg = &amp;lt; 0xe000e010 0x10 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
};
sram0: memory@20000000 {
device_type = &amp;quot;memory&amp;quot;;
compatible = &amp;quot;mmio-sram&amp;quot;;
reg = &amp;lt; 0x20000000 0x80000 &amp;gt;;
};
peripheral@50000000 {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x1 &amp;gt;;
ranges = &amp;lt; 0x0 0x50000000 0x10000000 &amp;gt;;
flash_controller: flash-controller@39000 {
compatible = &amp;quot;nordic,nrf53-flash-controller&amp;quot;;
reg = &amp;lt; 0x39000 0x1000 &amp;gt;;
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x1 &amp;gt;;
label = &amp;quot;NRF_FLASH_DRV_NAME&amp;quot;;
flash0: flash@0 {
compatible = &amp;quot;soc-nv-flash&amp;quot;;
label = &amp;quot;NRF_FLASH&amp;quot;;
erase-block-size = &amp;lt; 0x1000 &amp;gt;;
write-block-size = &amp;lt; 0x4 &amp;gt;;
reg = &amp;lt; 0x0 0x100000 &amp;gt;;
partitions {
compatible = &amp;quot;fixed-partitions&amp;quot;;
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x1 &amp;gt;;
boot_partition: partition@0 {
label = &amp;quot;mcuboot&amp;quot;;
reg = &amp;lt; 0x0 0x10000 &amp;gt;;
};
slot0_partition: partition@10000 {
label = &amp;quot;image-0&amp;quot;;
reg = &amp;lt; 0x10000 0x30000 &amp;gt;;
};
slot0_ns_partition: partition@40000 {
label = &amp;quot;image-0-nonsecure&amp;quot;;
reg = &amp;lt; 0x40000 0x40000 &amp;gt;;
};
slot1_partition: partition@80000 {
label = &amp;quot;image-1&amp;quot;;
reg = &amp;lt; 0x80000 0x30000 &amp;gt;;
};
slot1_ns_partition: partition@b0000 {
label = &amp;quot;image-1-nonsecure&amp;quot;;
reg = &amp;lt; 0xb0000 0x40000 &amp;gt;;
};
scratch_partition: partition@f0000 {
label = &amp;quot;image-scratch&amp;quot;;
reg = &amp;lt; 0xf0000 0xa000 &amp;gt;;
};
storage_partition: partition@fa000 {
label = &amp;quot;storage&amp;quot;;
reg = &amp;lt; 0xfa000 0x6000 &amp;gt;;
};
};
};
};
adc: adc@e000 {
compatible = &amp;quot;nordic,nrf-saadc&amp;quot;;
reg = &amp;lt; 0xe000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0xe 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
label = &amp;quot;ADC_0&amp;quot;;
#io-channel-cells = &amp;lt; 0x1 &amp;gt;;
};
dppic: dppic@17000 {
compatible = &amp;quot;nordic,nrf-dppic&amp;quot;;
reg = &amp;lt; 0x17000 0x1000 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
label = &amp;quot;DPPIC&amp;quot;;
};
egu0: egu@1b000 {
compatible = &amp;quot;nordic,nrf-egu&amp;quot;;
reg = &amp;lt; 0x1b000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x1b 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
egu1: egu@1c000 {
compatible = &amp;quot;nordic,nrf-egu&amp;quot;;
reg = &amp;lt; 0x1c000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x1c 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
egu2: egu@1d000 {
compatible = &amp;quot;nordic,nrf-egu&amp;quot;;
reg = &amp;lt; 0x1d000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x1d 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
egu3: egu@1e000 {
compatible = &amp;quot;nordic,nrf-egu&amp;quot;;
reg = &amp;lt; 0x1e000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x1e 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
egu4: egu@1f000 {
compatible = &amp;quot;nordic,nrf-egu&amp;quot;;
reg = &amp;lt; 0x1f000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x1f 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
egu5: egu@20000 {
compatible = &amp;quot;nordic,nrf-egu&amp;quot;;
reg = &amp;lt; 0x20000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x20 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
i2s0: i2s@28000 {
compatible = &amp;quot;nordic,nrf-i2s&amp;quot;;
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
reg = &amp;lt; 0x28000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x28 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;I2S_0&amp;quot;;
};
ipc: ipc@2a000 {
compatible = &amp;quot;nordic,nrf-ipc&amp;quot;;
reg = &amp;lt; 0x2a000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x2a 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
label = &amp;quot;IPC&amp;quot;;
};
kmu: kmu@39000 {
compatible = &amp;quot;nordic,nrf-kmu&amp;quot;;
reg = &amp;lt; 0x39000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x39 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
pdm0: pdm@26000 {
compatible = &amp;quot;nordic,nrf-pdm&amp;quot;;
reg = &amp;lt; 0x26000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x26 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;PDM_0&amp;quot;;
};
regulators: regulator@4000 {
compatible = &amp;quot;nordic,nrf-regulators&amp;quot;;
reg = &amp;lt; 0x4000 0x1000 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
vmc: vmc@81000 {
compatible = &amp;quot;nordic,nrf-vmc&amp;quot;;
reg = &amp;lt; 0x81000 0x1000 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
uart0: uart@8000 {
compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
reg = &amp;lt; 0x8000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x8 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
label = &amp;quot;UART_0&amp;quot;;
current-speed = &amp;lt; 0x1c200 &amp;gt;;
tx-pin = &amp;lt; 0x14 &amp;gt;;
rx-pin = &amp;lt; 0x16 &amp;gt;;
rts-pin = &amp;lt; 0x13 &amp;gt;;
cts-pin = &amp;lt; 0x15 &amp;gt;;
};
uart1: uart@9000 {
compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
reg = &amp;lt; 0x9000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x9 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;UART_1&amp;quot;;
};
uart2: uart@b000 {
compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
reg = &amp;lt; 0xb000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0xb 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;UART_2&amp;quot;;
};
uart3: uart@c000 {
compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
reg = &amp;lt; 0xc000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0xc 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;UART_3&amp;quot;;
};
i2c0: i2c@8000 {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
reg = &amp;lt; 0x8000 0x1000 &amp;gt;;
clock-frequency = &amp;lt; 0x186a0 &amp;gt;;
interrupts = &amp;lt; 0x8 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;I2C_0&amp;quot;;
};
i2c1: i2c@9000 {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
reg = &amp;lt; 0x9000 0x1000 &amp;gt;;
clock-frequency = &amp;lt; 0x186a0 &amp;gt;;
interrupts = &amp;lt; 0x9 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
label = &amp;quot;I2C_1&amp;quot;;
compatible = &amp;quot;nordic,nrf-twim&amp;quot;;
sda-pin = &amp;lt; 0x1e &amp;gt;;
scl-pin = &amp;lt; 0x1f &amp;gt;;
};
i2c2: i2c@b000 {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
reg = &amp;lt; 0xb000 0x1000 &amp;gt;;
clock-frequency = &amp;lt; 0x186a0 &amp;gt;;
interrupts = &amp;lt; 0xb 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;I2C_2&amp;quot;;
};
i2c3: i2c@c000 {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
reg = &amp;lt; 0xc000 0x1000 &amp;gt;;
clock-frequency = &amp;lt; 0x186a0 &amp;gt;;
interrupts = &amp;lt; 0xc 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;I2C_3&amp;quot;;
};
spi0: spi@8000 {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
reg = &amp;lt; 0x8000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x8 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;SPI_0&amp;quot;;
};
spi1: spi@9000 {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
reg = &amp;lt; 0x9000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x9 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;SPI_1&amp;quot;;
};
spi2: spi@b000 {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
reg = &amp;lt; 0xb000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0xb 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
label = &amp;quot;SPI_2&amp;quot;;
compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
sck-pin = &amp;lt; 0x20 &amp;gt;;
mosi-pin = &amp;lt; 0x20 &amp;gt;;
miso-pin = &amp;lt; 0x24 &amp;gt;;
};
spi3: spi@c000 {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
reg = &amp;lt; 0xc000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0xc 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;SPI_3&amp;quot;;
};
spi4: spi@a000 {
compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
reg = &amp;lt; 0xa000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0xa 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;SPI_4&amp;quot;;
};
pwm0: pwm@21000 {
compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
reg = &amp;lt; 0x21000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x21 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
label = &amp;quot;PWM_0&amp;quot;;
#pwm-cells = &amp;lt; 0x1 &amp;gt;;
ch0-pin = &amp;lt; 0x1c &amp;gt;;
};
pwm1: pwm@22000 {
compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
reg = &amp;lt; 0x22000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x22 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;PWM_1&amp;quot;;
#pwm-cells = &amp;lt; 0x1 &amp;gt;;
};
pwm2: pwm@23000 {
compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
reg = &amp;lt; 0x23000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x23 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;PWM_2&amp;quot;;
#pwm-cells = &amp;lt; 0x1 &amp;gt;;
};
pwm3: pwm@24000 {
compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
reg = &amp;lt; 0x24000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x24 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;PWM_3&amp;quot;;
#pwm-cells = &amp;lt; 0x1 &amp;gt;;
};
gpio0: gpio@842500 {
compatible = &amp;quot;nordic,nrf-gpio&amp;quot;;
gpio-controller;
reg = &amp;lt; 0x842500 0x300 &amp;gt;;
#gpio-cells = &amp;lt; 0x2 &amp;gt;;
label = &amp;quot;GPIO_0&amp;quot;;
status = &amp;quot;okay&amp;quot;;
phandle = &amp;lt; 0x2 &amp;gt;;
};
gpio1: gpio@842800 {
compatible = &amp;quot;nordic,nrf-gpio&amp;quot;;
gpio-controller;
reg = &amp;lt; 0x842800 0x300 &amp;gt;;
#gpio-cells = &amp;lt; 0x2 &amp;gt;;
ngpios = &amp;lt; 0x10 &amp;gt;;
label = &amp;quot;GPIO_1&amp;quot;;
status = &amp;quot;okay&amp;quot;;
};
rtc0: rtc@14000 {
compatible = &amp;quot;nordic,nrf-rtc&amp;quot;;
reg = &amp;lt; 0x14000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x14 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
clock-frequency = &amp;lt; 0x8000 &amp;gt;;
prescaler = &amp;lt; 0x1 &amp;gt;;
label = &amp;quot;RTC_0&amp;quot;;
};
rtc1: rtc@15000 {
compatible = &amp;quot;nordic,nrf-rtc&amp;quot;;
reg = &amp;lt; 0x15000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x15 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
clock-frequency = &amp;lt; 0x8000 &amp;gt;;
prescaler = &amp;lt; 0x1 &amp;gt;;
label = &amp;quot;RTC_1&amp;quot;;
};
clock: clock@5000 {
compatible = &amp;quot;nordic,nrf-clock&amp;quot;;
reg = &amp;lt; 0x5000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x5 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
label = &amp;quot;CLOCK&amp;quot;;
};
power: power@5000 {
compatible = &amp;quot;nordic,nrf-power&amp;quot;;
reg = &amp;lt; 0x5000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x5 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
wdt: wdt0: watchdog@18000 {
compatible = &amp;quot;nordic,nrf-watchdog&amp;quot;;
reg = &amp;lt; 0x18000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x18 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
label = &amp;quot;WDT&amp;quot;;
};
wdt1: watchdog@19000 {
compatible = &amp;quot;nordic,nrf-watchdog&amp;quot;;
reg = &amp;lt; 0x19000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x19 0x1 &amp;gt;;
status = &amp;quot;disabled&amp;quot;;
label = &amp;quot;WDT_1&amp;quot;;
};
timer0: timer@f000 {
compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
status = &amp;quot;okay&amp;quot;;
reg = &amp;lt; 0xf000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0xf 0x1 &amp;gt;;
prescaler = &amp;lt; 0x0 &amp;gt;;
label = &amp;quot;TIMER_0&amp;quot;;
};
timer1: timer@10000 {
compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
status = &amp;quot;okay&amp;quot;;
reg = &amp;lt; 0x10000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x10 0x1 &amp;gt;;
prescaler = &amp;lt; 0x0 &amp;gt;;
label = &amp;quot;TIMER_1&amp;quot;;
};
timer2: timer@11000 {
compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
status = &amp;quot;okay&amp;quot;;
reg = &amp;lt; 0x11000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x11 0x1 &amp;gt;;
prescaler = &amp;lt; 0x0 &amp;gt;;
label = &amp;quot;TIMER_2&amp;quot;;
};
};
cryptocell: crypto@50844000 {
compatible = &amp;quot;nordic,nrf-cc312&amp;quot;;
reg = &amp;lt; 0x50844000 0x1000 &amp;gt;;
label = &amp;quot;CRYPTOCELL&amp;quot;;
status = &amp;quot;okay&amp;quot;;
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x1 &amp;gt;;
cryptocell312: crypto@50845000 {
compatible = &amp;quot;arm,cryptocell-312&amp;quot;;
reg = &amp;lt; 0x50845000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x44 0x1 &amp;gt;;
label = &amp;quot;CRYPTOCELL312&amp;quot;;
};
};
gpiote: gpiote@5000d000 {
compatible = &amp;quot;nordic,nrf-gpiote&amp;quot;;
reg = &amp;lt; 0x5000d000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0xd 0x5 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
label = &amp;quot;GPIOTE_0&amp;quot;;
};
spu: spu@50003000 {
compatible = &amp;quot;nordic,nrf-spu&amp;quot;;
reg = &amp;lt; 0x50003000 0x1000 &amp;gt;;
interrupts = &amp;lt; 0x3 0x1 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
ficr: ficr@ff0000 {
compatible = &amp;quot;nordic,nrf-ficr&amp;quot;;
reg = &amp;lt; 0xff0000 0x1000 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
uicr: uicr@ff8000 {
compatible = &amp;quot;nordic,nrf-uicr&amp;quot;;
reg = &amp;lt; 0xff8000 0x1000 &amp;gt;;
status = &amp;quot;okay&amp;quot;;
};
};
cpus {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x0 &amp;gt;;
cpu@0 {
device_type = &amp;quot;cpu&amp;quot;;
compatible = &amp;quot;arm,cortex-m33f&amp;quot;;
reg = &amp;lt; 0x0 &amp;gt;;
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x1 &amp;gt;;
mpu: mpu@e000ed90 {
compatible = &amp;quot;arm,armv8m-mpu&amp;quot;;
reg = &amp;lt; 0xe000ed90 0x40 &amp;gt;;
arm,num-mpu-regions = &amp;lt; 0x10 &amp;gt;;
};
};
};
leds {
compatible = &amp;quot;gpio-leds&amp;quot;;
led0: led_0 {
gpios = &amp;lt; &amp;amp;gpio0 0x1c 0x1 &amp;gt;;
label = &amp;quot;Green LED 0&amp;quot;;
};
led1: led_1 {
gpios = &amp;lt; &amp;amp;gpio0 0x1d 0x1 &amp;gt;;
label = &amp;quot;Green LED 1&amp;quot;;
};
led2: led_2 {
gpios = &amp;lt; &amp;amp;gpio0 0x1e 0x1 &amp;gt;;
label = &amp;quot;Green LED 2&amp;quot;;
};
led3: led_3 {
gpios = &amp;lt; &amp;amp;gpio0 0x1f 0x1 &amp;gt;;
label = &amp;quot;Green LED 3&amp;quot;;
};
};
buttons {
compatible = &amp;quot;gpio-keys&amp;quot;;
button0: button_0 {
gpios = &amp;lt; &amp;amp;gpio0 0x17 0x11 &amp;gt;;
label = &amp;quot;Push button 1&amp;quot;;
};
button1: button_1 {
gpios = &amp;lt; &amp;amp;gpio0 0x18 0x11 &amp;gt;;
label = &amp;quot;Push button 2&amp;quot;;
};
button2: button_2 {
gpios = &amp;lt; &amp;amp;gpio0 0x8 0x11 &amp;gt;;
label = &amp;quot;Push button 3&amp;quot;;
};
button3: button_3 {
gpios = &amp;lt; &amp;amp;gpio0 0x9 0x11 &amp;gt;;
label = &amp;quot;Push button 4&amp;quot;;
};
};
reserved-memory {
#address-cells = &amp;lt; 0x1 &amp;gt;;
#size-cells = &amp;lt; 0x1 &amp;gt;;
ranges;
sram0_image: image@20000000 {
reg = &amp;lt; 0x20000000 0x70000 &amp;gt;;
};
sram0_s: image_s@20000000 {
reg = &amp;lt; 0x20000000 0x10000 &amp;gt;;
};
sram0_ns: image_ns@20010000 {
reg = &amp;lt; 0x20010000 0x60000 &amp;gt;;
};
sram0_shared: memory@20070000 {
reg = &amp;lt; 0x20070000 0x10000 &amp;gt;;
};
};
};&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276315?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 21:56:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c38413ab-9d4a-4d93-861f-b86187f6d458</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Heidi,&lt;/p&gt;
&lt;p&gt;No problem, we are all learning in the process.&lt;/p&gt;
[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/276309#276309"]At a closer look:&amp;nbsp;&lt;em&gt;&amp;quot;This value primarily identifies the channel within the ADC API&amp;quot;.&amp;nbsp;&lt;/em&gt;So the value of the channel_id does not matter (in the range of 0 to 7) as long as it is used consistently to identify that channel.&amp;nbsp;This explains why channel ID 0 is used for AIN0 and channel 2 is used for AIN2, &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c#L57-L60"&gt;here&lt;/a&gt;.[/quote]
&lt;p&gt;I am not sure I understand what you are trying to say here.&lt;/p&gt;
&lt;p&gt;I understand the need to configure which analog pin is being used but I&amp;nbsp;am still not clear on which one of these two macros is doing this job. If as you said it is &lt;strong&gt;ADC_1ST_CHANNEL_INPUT&lt;/strong&gt;&amp;nbsp;then&amp;nbsp;why is &lt;strong&gt;ADC_1ST_CHANNEL_ID &lt;/strong&gt;needed?&lt;/p&gt;
&lt;p&gt;The best way to understand what channel_id does is to see where it is used in the driver code. There is a driver function called &lt;strong&gt;channel_setup&lt;/strong&gt; but I could not locate it. Could you please ask your colleagues developers to point us where in the driver code this function that uses channel_id and channel_input is.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276309?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 21:02:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41fd880f-ce4e-43af-83a1-00fdfde31ea6</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You know what, I misunderstood the description of channel_id. Sorry about that.&lt;/p&gt;
&lt;p&gt;At a closer look:&amp;nbsp;&lt;em&gt;&amp;quot;This value primarily identifies the channel within the ADC API&amp;quot;.&amp;nbsp;&lt;/em&gt;So the value of the channel_id does not matter (in the range of 0 to 7) as long as it is used consistently to identify that channel.&amp;nbsp;This explains why channel ID 0 is used for AIN0 and channel 2 is used for AIN2, &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c#L57-L60"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;My mistake, sorry for the confusion! There is no channel id offset and the sample should work as expected.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes, the table I linked to is apparently incorrect, so this is the correct pin mapping.&amp;nbsp;&lt;/p&gt;
&lt;table height="151" width="175"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AIN0&lt;/td&gt;
&lt;td&gt;P0.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN1&lt;/td&gt;
&lt;td&gt;P0.05&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN2&lt;/td&gt;
&lt;td&gt;P0.06&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN3&lt;/td&gt;
&lt;td&gt;P0.07&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN4&lt;/td&gt;
&lt;td&gt;P0.25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN5&lt;/td&gt;
&lt;td&gt;P0.26&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN6&lt;/td&gt;
&lt;td&gt;P0.27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIN7&lt;/td&gt;
&lt;td&gt;P0.28&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Learner"]Bingo! it works.[/quote]
&lt;p&gt;&amp;nbsp;Did it work with the analog device plugged into GPIO pin 28 or pin 6?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If it was pin 28, could you attach the file with the path build_folder/zephyr/zephyr.dts just so I can confirm this?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Again, sorry for the confusion.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276295?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 16:22:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7556c1b5-24a4-41a9-a91e-de2035bd8024</guid><dc:creator>Learner</dc:creator><description>[quote userid="92434" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/276283#276283"]So, this means channel_id = 0 i.e. index zero into the channel array points to AIN0.[/quote]
&lt;p&gt;Since it seems we have the channel_id index offset by one in the nRF5340PDK, does it mean the examples referred to will not work as expected?&lt;/p&gt;
&lt;p&gt;According to the PCA10095_schematics of the nRF5340PDK &lt;strong&gt;pin P0.28 is AIN7&lt;/strong&gt;. So,&amp;nbsp;I connected a potentiometer to pins: P0.28, VDD, GND and tried to run the light intensity controller example but the adc did not work with this configuration code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#define ADC_1ST_CHANNEL_ID 7&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;#define ADC_1ST_CHANNEL_INPUT NRF_SAADC_INPUT_AIN7&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So, I looked closely to pin P0.28 on the back of the pdk board and realised that P0.28 is actually labelled &lt;strong&gt;(A2)&lt;/strong&gt;. So, I changed the config to,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#define ADC_1ST_CHANNEL_ID 2&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;#define ADC_1ST_CHANNEL_INPUT NRF_SAADC_INPUT_AIN2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;and Bingo! it works. So, it seems that for the nRF5340PDK the values used for&amp;nbsp;&lt;span&gt;ADC_1ST_CHANNEL_ID&amp;nbsp; and&amp;nbsp;ADC_1ST_CHANNEL_INPUT&amp;nbsp;must the same. Any comments?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mohamed&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276283?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 15:39:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bd3d82f-4844-4952-846a-d73e789016cf</guid><dc:creator>Learner</dc:creator><description>[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/276237#276237"]&lt;p&gt;Another thing I wanted to clarify by using the custom binding of the sample as an example, is&amp;nbsp;&lt;a href="https://github.com/pabigot/fw-nrfconnect-nrf/blob/sample/20201020a/samples/myapp/boards/nrf5340pdk_nrf5340_cpuapp.overlay#L7"&gt;this line&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class="content-scrollable-wrapper" style="overflow:auto;"&gt;&lt;div class="evolution-code-editor theme-clouds"&gt;&lt;a href="#" class="fullscreen"&gt;Fullscreen&lt;/a&gt;&lt;div class=" ace_editor ace-clouds" style="width:100%;height:14.4px;"&gt;&lt;div class="ace_gutter"&gt;&lt;div class="ace_layer ace_gutter-layer ace_folding-enabled" style="margin-top:0px;height:43.2px;width:40px;"&gt;&lt;div class="ace_gutter-cell " style="height:14.4px;"&gt;1&lt;/div&gt;&lt;/div&gt;&lt;div class="ace_gutter-active-line" style="display:none;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ace_scroller" style="left:40px;right:0px;bottom:0px;"&gt;&lt;div class="ace_content" style="margin-top:0px;width:582px;height:43.2px;margin-left:0px;"&gt;&lt;div class="ace_layer ace_print-margin-layer"&gt;&lt;div class="ace_print-margin" style="left:531.82px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ace_layer ace_marker-layer"&gt;&lt;/div&gt;&lt;div class="ace_layer ace_text-layer" style="padding:0px 4px;"&gt;&lt;div class="ace_line" style="height:14.40000057220459px;"&gt;io-channels = &amp;lt;&amp;amp;adc 0&amp;gt;, &amp;lt;&amp;amp;adc 1&amp;gt;;&lt;/div&gt;&lt;/div&gt;&lt;div class="ace_layer ace_marker-layer"&gt;&lt;/div&gt;&lt;div class="ace_layer ace_cursor-layer ace_hidden-cursors"&gt;&lt;div class="ace_cursor" style="left:4px;top:0px;width:6.59775px;height:14.4px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ace_scrollbar ace_scrollbar-v" style="display:none;width:22px;bottom:0px;"&gt;&lt;div class="ace_scrollbar-inner" style="width:22px;height:14.4px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ace_scrollbar ace_scrollbar-h" style="display:none;height:22px;left:40px;right:0px;"&gt;&lt;div class="ace_scrollbar-inner" style="height:22px;width:582px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="height:auto;width:auto;top:0px;left:0px;position:absolute;white-space:pre;font:inherit;overflow:hidden;"&gt;&lt;div style="height:auto;width:auto;top:0px;left:0px;position:absolute;white-space:pre;font:inherit;overflow:visible;"&gt;&lt;/div&gt;&lt;div style="height:auto;width:auto;top:0px;left:0px;position:absolute;white-space:pre;font-style:inherit;font-size:inherit;line-height:inherit;font-family:inherit;overflow:visible;"&gt;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class="ui-code" style="display:none;"&gt;io-channels = &amp;lt;&amp;amp;adc 0&amp;gt;, &amp;lt;&amp;amp;adc 1&amp;gt;;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As you can see, the io-channels are ´[&amp;amp;adc 0]´ and ´[&amp;amp;adc 1]´ which maps the ADC peripheral to channel 0 and 1. This just maps the ADC node to the analog input of channel 0 and the analog input of channel 1, which is AIN1 and AIN2, which then maps&amp;nbsp;to GPIO pin P0.04 and P0.05 on the PDK, according to &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf5340_pdk/UG/nrf5340_PDK/hw_analog_pins.html"&gt;this table&lt;/a&gt;&amp;nbsp;describing the mapping of analog pins on the nRF5340 PDK.&lt;/p&gt;[/quote]
&lt;p&gt;&lt;span&gt;According to the PCA10095 schematics of the nRF5340 PDK&amp;nbsp; (nRF5340-QKAA) pin 4 on P0.04 is AIN0 not AIN1.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have already raised this issue with Martin Lesund about three weeks ago and he said he will&amp;nbsp;get this corrected. There seems to be some discrepancy between the user guide and the schematics. The latter is correct.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So, this means channel_id = 0 i.e. index zero into the channel array points to AIN0.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mohamed&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276279?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 15:25:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d028cda7-9410-4d6b-9597-9acd1fcb8f77</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Heidi,&lt;/p&gt;
&lt;p&gt;Thank you for your answers.&lt;/p&gt;
[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/276237#276237"]So the difference is that the ´[channel_id]´ is the index into the channel array (AIN1 has index 0, AIN2 has index 1 etc.) and ´[input_positive]´ (which is the channel input) is the specific analog input, so AIN1 and AIN2.&amp;nbsp;&amp;nbsp;[/quote]
&lt;p&gt;If channel_id = 0 i.e. index zero into the channel array gets AIN1 then what is the index for channel AIN0?&lt;/p&gt;
&lt;p&gt;I have not finished reading your answers but I thought I ask this question in case it affects my understanding of the remainder of your answer.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276237?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 13:52:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4cbb9fe-c7a0-4a4b-ac48-27aaed91960d</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/pabigot/fw-nrfconnect-nrf/tree/sample/20201020a"&gt;https://github.com/pabigot/fw-nrfconnect-nrf/tree/sample/20201020a&lt;/a&gt;&amp;nbsp;has the example in samples/myapp.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/pabigot/fw-nrfconnect-nrf/blob/sample/20201020a/samples/myapp/00-README.md"&gt;README file&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;has a lot of information.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This example shows how to represent analog input signals and associated hardware properties in a devicetree bindings. The described problem domain was for two analog inputs, one for an op-amp, one for an RC-divider.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There is a custom binding for the setup you described and it configures the ADC and reads the raw data. It also converts it to millivolts, but this may be useless depending on what you want to do.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;________________________________________________________________________&lt;/p&gt;
&lt;p&gt;Now onto your questions.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Learner"]&amp;nbsp;&lt;strong&gt;#define ADC_1ST_CHANNEL_ID 0&lt;/strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; [/quote]
&lt;p&gt;&amp;nbsp;This is just defining the first channel ID as zero and the second channel ID as 1.&amp;nbsp;&lt;/p&gt;
[quote user="Learner"]#define ADC_1ST_CHANNEL_INPUT NRF_SAADC_INPUT_AIN1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;This is defining the first channel input as analog input 1 and the second channel input as analog input 2.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The real action happens a little&amp;nbsp;lower down in the code,&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c#L218-L237"&gt;here&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static const struct adc_channel_cfg m_1st_channel_cfg = {
	.gain             = ADC_GAIN,
	.reference        = ADC_REFERENCE,
	.acquisition_time = ADC_ACQUISITION_TIME,
	.channel_id       = ADC_1ST_CHANNEL_ID,      // 0
#if defined(CONFIG_ADC_CONFIGURABLE_INPUTS)
	.input_positive   = ADC_1ST_CHANNEL_INPUT,   // NRF_SAADC_INPUT_AIN1
#endif
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So the descriptions of these two properties (`[channel_id]` and `[input positive]`) are explained in the definition of the&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/include/drivers/adc.h#L92-L155"&gt;adc_channel_cfg&lt;/a&gt;&amp;nbsp;struct. I have pasted them below in cursive and then added clarifying comments for your specific case that are not in cursive but underlined.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;channel_id: &lt;em&gt;This value primarily identifies the channel within the ADC API - when a read request is done, the corresponding bit in the ´[channels]´ `[channels]´ field of the ´[adc_sequence]´ structure must be set to include this channel in the sampling.&lt;/em&gt; &lt;span style="text-decoration:underline;"&gt;In the test_adc sample, this is done &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c#L293"&gt;here&lt;/a&gt;&amp;nbsp;or &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c#L326"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;For hardware that does not allow the selection of analog inputs for given channels, but rather have dedicated ones, this value also selects the physical ADC input to be used in the sampling. &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Otherwise, when it is needed to explicitly select an analog input for the channel, or two inputs when the channel is a differential one, the selection is done in ´[input_positive]´ and ´[input_negative]´ fields.&lt;/em&gt; &lt;span style="text-decoration:underline;"&gt;Since our hardware lets us explicitly select analog inputs, this is done &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c#L224"&gt;here&lt;/a&gt;, to select&amp;nbsp;NRF_SAADC_INPUT_AIN1.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Particular drivers indicate which one of the above two cases they support by selecting or not a special hidden Kconfig option named ADC_CONFIGURABLE_INPUTS.&lt;/em&gt;&lt;span&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;em&gt;If this option is not selected, the macro CONFIG_ADC_CONFIGURABLE_INPUTS is not defined and consequently, the mentioned two fields are not present in this structure.&amp;nbsp;&lt;/em&gt;&lt;span style="text-decoration:underline;"&gt;This option is selected in the nrfx ADC driver&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/drivers/adc/Kconfig.nrfx#L33"&gt;here&lt;/a&gt; when you enable &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/drivers/adc/Kconfig.nrfx#L29"&gt;ADC_NRFX_SAADC&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;While this API allows identifiers from range 0-31, particular drivers may support only a limited number of channel identifiers (dependent on the underlying hardware capabilities or configured via a dedicated Kconfig option).&lt;/em&gt; &lt;span style="text-decoration:underline;"&gt;In our case, the nrfx ADC driver only allows 8 channels&amp;nbsp;by setting&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/drivers/adc/Kconfig.nrfx#L19"&gt;ADC_NRFX_ADC_CHANNEL_COUNT&lt;/a&gt;&amp;nbsp;to the range 1 to 8. This means channel_id has the range 0 to 7.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;input_positive: &lt;em&gt;Positive ADC input, This is a driver dependent value that identifies an ADC input to be associated with the channel.&amp;nbsp;&lt;/em&gt;&lt;span style="text-decoration:underline;"&gt;So, in our case, we are associating the ADC input&amp;nbsp;NRF_SAADC_INPUT_AIN1 with the channel.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So the difference is that the ´[channel_id]´ is the index into the channel array (AIN1 has index 0, AIN2 has index 1 etc.) and ´[input_positive]´ (which is the channel input) is the specific analog input, so AIN1 and AIN2.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another thing I wanted to clarify by using the custom binding of the sample as an example, is&amp;nbsp;&lt;a href="https://github.com/pabigot/fw-nrfconnect-nrf/blob/sample/20201020a/samples/myapp/boards/nrf5340pdk_nrf5340_cpuapp.overlay#L7"&gt;this line&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;io-channels = &amp;lt;&amp;amp;adc 0&amp;gt;, &amp;lt;&amp;amp;adc 1&amp;gt;;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As you can see, the io-channels are ´[&amp;amp;adc 0]´ and ´[&amp;amp;adc 1]´ which maps the ADC peripheral to channel 0 and 1. This just maps the ADC node to the analog input of channel 0 and the analog input of channel 1, which is AIN1 and AIN2, which then maps&amp;nbsp;to GPIO pin P0.04 and P0.05 on the PDK, according to &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf5340_pdk/UG/nrf5340_PDK/hw_analog_pins.html"&gt;this table&lt;/a&gt;&amp;nbsp;describing the mapping of analog pins on the nRF5340 PDK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So this mapping is a part of the hardware and isn&amp;#39;t something the user needs to configure. The user just needs to configure the ADC node to specific channels in the range 0 to 7. So, for instance if you want to use AIN5 and AIN7 (which on the PDK is P0.07 and P0.26 respectively), you would need to define these io-channels.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;io-channels = &amp;lt;&amp;amp;adc 4&amp;gt;, &amp;lt;&amp;amp;adc 6&amp;gt;;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then due to the HW mapping of the board, these io-channels are GPIO pin 7 and GPIO pin 26.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is something I just learned as well, which is why I haven&amp;#39;t corrected it before.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Learner"]&amp;nbsp; &amp;nbsp; Is this selecting analog input pin AIN0 i.e. port P0.04?[/quote]
&lt;p&gt;&amp;nbsp;So finally to answer this question, this line&lt;/p&gt;
&lt;p&gt;&lt;span&gt;´[#&lt;/span&gt;&lt;span&gt;define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;ADC_1ST_CHANNEL_INPUT&lt;/span&gt;&lt;span&gt; NRF_SAADC_INPUT_AIN1]´&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;along with this line&lt;/p&gt;
&lt;p&gt;&lt;span&gt;´[.&lt;/span&gt;&lt;span&gt;input_positive&lt;/span&gt;&lt;span&gt; = ADC_1ST_CHANNEL_INPUT]´&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;sets the ADC input to be the analog input AIN1 (i.e GPIO pin 0.04, though this connection exists in HW and isn&amp;#39;t something we need to configure in SW).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I hope that was clarifying. Again sorry for&amp;nbsp;sometimes coming with new and different information, but I am also learning along with you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Heidi&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276153?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 10:59:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78a83059-102a-4503-8d2c-0e4db20ce3be</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Thank you Heidi.&lt;/p&gt;
&lt;p&gt;For now I will get rid of the overlay file and use the raw adc readings. I think this will be good enough for our application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am not sure what&amp;nbsp;&lt;span&gt;CHANNEL_INPUT&lt;/span&gt;&amp;nbsp;adc configuration parameter. in the code fragment below does. The code has been extracted from&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;strong&gt;#define ADC_1ST_CHANNEL_ID 0&lt;/strong&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; &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; &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; &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; Is this selecting analog input pin AIN0 i.e. port P0.04?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#define ADC_1ST_CHANNEL_INPUT NRF_SAADC_INPUT_AIN1&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; &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; &amp;nbsp; &amp;nbsp;&lt;/strong&gt;It is used to set&amp;nbsp; .input_positive in&amp;nbsp;struct adc_channel_cfg&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;This equates to 2 but not sure what it does.&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; &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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;What is the difference between CHANNEL_ID and CHANNEL_INPUT?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#define ADC_2ND_CHANNEL_ID 2&lt;/strong&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; &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; &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; &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;span&gt;Is this selecting analog input pin AIN2 i.e. port P0.06?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#define ADC_2ND_CHANNEL_INPUT NRF_SAADC_INPUT_AIN2&lt;/strong&gt;&lt;strong&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; &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; &amp;nbsp; &lt;/strong&gt;&amp;nbsp;It is used to set&amp;nbsp; .input_positive in&amp;nbsp;struct adc_channel_cfg&amp;nbsp;&lt;strong&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/strong&gt;This equates to 3 but not sure what it does.&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; &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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span&gt;What is the difference between CHANNEL_ID and CHANNEL_INPUT?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mohamed&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/276025?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 18:31:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:551ca4c9-7b48-4659-8d1f-9cc96d76bb95</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To get the raw ADC information, you don&amp;#39;t need a device tree `[compatible]`, because this is just what the ADC driver returns. You only need this when there is external hardware-related information (like the resistance and capacitance of an RC-divider) that needs to be exposed to the code to convert a raw ADC reading into something meaningful. This is shown in the battery sample I have linked to previously.&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;The `[voltage-divider]` is intended to match the Linux binding with the same `[compatible]` name. I can&amp;#39;t find a Linux compatible for &amp;quot;RC-divider&amp;quot; but if there is one try to use that instead.&lt;/p&gt;
&lt;p&gt;Otherwise, users can create their own bindings&amp;nbsp;and then use this as the `[compatible]`property.&amp;nbsp;See the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/dts/bindings.html"&gt;Zephyr Bindings documentation&lt;/a&gt;&amp;nbsp;before you start writing it, for the file syntax and conventions, etc.&amp;nbsp; Make sure to use a `[compatible]` that&amp;#39;s namespaced to avoid conflict with other devicetree node identifiers; use something like `[companyname,rc-divider]`.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I spoke to one of the developers and he is going to try to write a binding and small sample&amp;nbsp;for the HW setup you are using (the op-amp and RC-divider).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Learner"]Please do. I cannot believe nordic do not provide a driver for their ad peripheral...[/quote]
&lt;p&gt;&amp;nbsp;Nordic definitely has a driver for the ADC peripheral, it&amp;#39;s in&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/drivers/adc/adc_nrfx_saadc.c"&gt;zephyr/drivers/adc/adc_nrfx_saadc.c&lt;/a&gt;, and included in the general zephyr ADC driver &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/drivers/adc/CMakeLists.txt#L11"&gt;here&lt;/a&gt;&amp;nbsp;when &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/CONFIG_ADC_NRFX_SAADC.html"&gt;CONFIG_ADC_NRFX_SAADC&lt;/a&gt;&amp;nbsp;is enabled.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This driver is used in the battery sample&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/samples/boards/nrf/battery/src/battery.c#L15"&gt;here&lt;/a&gt;. This is what you will use in the main.c file, because not everything can be done in the device tree.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But we can wait for the binding and sample, and see if that helps you along!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/275978?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 14:24:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abf1d998-17f6-456a-a901-cf0f58a56d7d</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Heidi,&lt;/p&gt;
&lt;p&gt;I may not always get the answer I am looking for but I do appreciate your efforts. A big THANK YOU.&lt;/p&gt;
[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/275848#275848"]The reason this is complicated is that we are trying to do it through an overlay file and there is very little sample code available, as it seems this isn&amp;#39;t the common way to do it.[/quote]
&lt;p&gt;Yes, I did see examples using the adc peripheral but they all use the #define and DT_&amp;nbsp;macros. I thought since almost every other hardware configuration can be done via the overlay file it would be a neat way to get the adc peripheral configured in the same way. If nordic/zephyr experts think that this is not the way to go about it then it is fine but they must let users like me know as early as possible so that no time is wasted. I may have to drop the idea of using the overlay file for the adc peripheral, which is a shame because I think it is a neater way.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/275848#275848"]Do you just want a way to get the raw a2d results?[/quote]
&lt;p&gt;Yes, I was expecting to get raw (LSB) values that I can then process/scale in my firmware. So, the &amp;quot;nordic,nrf-saadc&amp;quot; should provide that.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/275848#275848"]This is what&amp;nbsp;I was told by one of the developers. We can&amp;#39;t use it because it&amp;#39;s only made to instantiate the ADC peripheral, and that&amp;#39;s not what this node is. I can try to find a better explanation for this.&amp;nbsp;[/quote]
&lt;p&gt;Please do. I cannot believe nordic do not provide a driver for their ad peripheral...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/275848#275848"]What is this? Is this from the log file?[/quote]
&lt;p&gt;No, this is just me trying to make my post more readable and break it into sections to make life easier for the support staff like your good self.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/275848?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 10:32:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8fc0bc6-5eb8-4175-a653-a248fe0aa4a1</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Let me answer these questions first:&lt;/p&gt;
&lt;p&gt;1. In the overlay and dts files, comments are added with &amp;quot;// Comment&amp;quot; or for multiple lines &amp;quot;/* Comment 1 \n Comment 2 */&amp;quot;.&lt;/p&gt;
&lt;p&gt;The comment sign &amp;quot;#&amp;quot; is used for configuration files like prj.conf and KConfig files.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. Yes, node-name@... means there should be some unit-address in &amp;quot;...&amp;quot; but this depends on the SoC which is why it&amp;#39;s not included.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m still working on getting some more info about the ADC peripheral.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Learner"]Why can&amp;#39;t I use the &amp;quot;nordic,nrf-saadc&amp;quot; driver since it is the native nordic adc driver?[/quote]
&lt;p&gt;&amp;nbsp;This is what&amp;nbsp;I was told by one of the developers. We can&amp;#39;t use it because it&amp;#39;s only made to instantiate the ADC peripheral, and that&amp;#39;s not what this node is. I can try to find a better explanation for this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you just want a way to get the raw a2d results?&amp;nbsp;You can take a look at t&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c"&gt;his sample code&lt;/a&gt;&amp;nbsp;which shows how to get raw ADC data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The light controller example that you were working with also&amp;nbsp;demonstrates how to get raw ADC data from an analog input.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The reason this is complicated is that we are trying to do it through an overlay file and there is very little sample code available, as it seems this isn&amp;#39;t the common way to do it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Learner"]ADC raw (LSB) conversion results:&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; &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; &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; &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; &amp;nbsp;----------------------------------------------[/quote]
&lt;p&gt;&amp;nbsp;What is this? Is this from the log file?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/275825?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 09:46:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34334465-2165-42f2-856a-48c0c8ac4917</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Good morning Heidi,&lt;/p&gt;
[quote userid="82276" url="~/f/nordic-q-a/66702/build-zephyr-elf-versus-build-solution/275759#275759"]What do you mean by this? I assume you will have to change the main.c file, firstly to bind the IO-channels.&amp;nbsp;[/quote]
&lt;p&gt;Yes, of course, to get the binding to work using the new labels with the DT_ macros.&lt;/p&gt;
&lt;p&gt;ADC raw (LSB) conversion results:&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; &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; &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; &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; &amp;nbsp;----------------------------------------------&lt;/p&gt;
&lt;p&gt;I used ADC on various microcontrollers before and the ADC peripherals were straight forward to use and always provided raw (LSB) a2d results. Whys is it so complicated with this SoC/zephyr?&lt;/p&gt;
&lt;p&gt;Why can&amp;#39;t I use the &amp;quot;nordic,nrf-saadc&amp;quot; driver since it is the native nordic adc driver?&lt;/p&gt;
&lt;p&gt;General questions:&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; &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; &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; &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; &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;/p&gt;
&lt;p&gt;1- How can I add a comment in the overlay and dts files? I added few lines with a leading # but it caused problems. Does the # need to be in a particular location on a line?&lt;/p&gt;
&lt;p&gt;2- I sometimes see fragment of DeviceTree code containing this &lt;span style="color:#0000ff;"&gt;&lt;strong&gt;@...&lt;/strong&gt;&lt;/span&gt; Does this mean the user has to replace the &lt;span style="color:#0000ff;"&gt;&lt;strong&gt;...&lt;/strong&gt;&lt;/span&gt; with a number?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build zephyr.elf versus Build solution</title><link>https://devzone.nordicsemi.com/thread/275759?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 07:14:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68d44def-c45c-4bc2-880e-e65803eba5d4</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Learner"]However, it is still rather confusing because looking at the definition of sub-node (a) and sub-node (c) they are identical but in fact they are telling us different information about the sub-node.[/quote]
&lt;p&gt;&amp;nbsp;I agree that it might be confusing, but you cannot look at the unit-addresses of nodes alone, you always have to look at the unit-address in context to the parent node. And when you look at the parent node of sub-node a versus sub-node c it becomes clear that sub-node a&amp;#39;s &amp;quot;0&amp;quot; means an index into the cs-gpios array and sub-node c&amp;#39;s &amp;quot;0&amp;quot; is just &amp;quot;NULL&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For the binding, I was wrong, you cannot just use the raw string as the argument. You need to use the following&amp;nbsp;macros for the first and second IO-channel respectively:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;DT_IO_CHANNELS_LABEL_BY_IDX(DT_NODELABEL(n),0)
DT_IO_CHANNELS_LABEL_BY_IDX(DT_NODELABEL(n),1)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As for the issue with the voltage-divider, I am just as confused as you but I will ask around if anyone has any experience using it with the circuit you are using.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Learner"]Maybe I Should make changes to the source code (the light intensity controller example) in main.c when I am using the overlay file ?[/quote]
&lt;p&gt;&amp;nbsp;What do you mean by this? I assume you will have to change the main.c file, firstly to bind the IO-channels.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>