<?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>MCUboot on the Thingy91</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81529/mcuboot-on-the-thingy91</link><description>I&amp;#39;m trying to duplicate the boot behavior of a Thingy91 on a custom board, i.e. SW4:BOOT and SW3:BUTTON on power up, but the switches available use different IO. I&amp;#39;m wondering where and how to modify the configuration. 
 Thanks, 
 JT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 14 Nov 2021 17:09:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81529/mcuboot-on-the-thingy91" /><item><title>RE: MCUboot on the Thingy91</title><link>https://devzone.nordicsemi.com/thread/338886?ContentTypeID=1</link><pubDate>Sun, 14 Nov 2021 17:09:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c7ac8e8-3678-4908-8db5-c9923902e665</guid><dc:creator>John_Turner</dc:creator><description>&lt;p&gt;Hi Ted,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m really just beginning to work with Zephyr but I am developing an appreciation for it&amp;#39;s flexibility. The video (Marti Bolivar) was quite helpful and the specific segment on I2C/SPI was a bit of a watershed moment for understanding the philosophy behind the approach. My board uses an SPI device that&amp;#39;s also on the THINGY91 so now I&amp;#39;m looking forward to bringing up instead of dreading it.&lt;/p&gt;
&lt;p&gt;On MCUBoot; Originally, I was expecting to find a unique device tree file for MCUBoot but since it&amp;#39;s meant to be independent of the operating system having some other form of hardware definition is understandable. One thing I thought might have been configurable specifically for MCUBoot would be the UART but it does take that definition from the DTS file for the board.&lt;/p&gt;
&lt;p&gt;JT&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUboot on the Thingy91</title><link>https://devzone.nordicsemi.com/thread/338441?ContentTypeID=1</link><pubDate>Wed, 10 Nov 2021 17:50:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19315eff-9d9c-4ecd-8081-26f3618667a0</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Good morning John,&lt;/p&gt;
&lt;p&gt;Thank you for sharing the nRF52840 and 9160 dot conf files.&amp;nbsp; On review I have copies of those as well, as part of Nordic&amp;#39;s sdk-nrf v1.6.1.&amp;nbsp; And pretty much in the same path starting at my Nordic SDK `west` workspace root directory.&lt;/p&gt;
&lt;p&gt;This is very interesting to me to see such hardware specific defines in a Kconfig file.&amp;nbsp; There are references to specific pins, which I&amp;#39;m not accustomed to see in Kconfig files.&amp;nbsp; Now you have me curious to see how mcuboot is using these options, and why (at least the named pin) is not in a dts file for this project or board?&lt;/p&gt;
&lt;p&gt;Are you already somewhat familiar with the languages / paradigms of Kconfig and Device Tree Source? In my reading and use so far I find that device tree files are specifically for describing hardware arrangements, largely the resources and on-chip peripherals of a given microcontroller, SoC or SiP.&amp;nbsp; Our DTS files are at build time quickly (or early) converted by `dtc` to C sources, which are then compiled by gcc or crosstool-ng or similar in the more traditional compilation sense.&lt;/p&gt;
&lt;p&gt;Kconfig in contrast provides high level and finely granular ways of enabling more programmatic things in a project.&amp;nbsp; There are often many hardware references in a project&amp;#39;s Kconfig files.&amp;nbsp; For example, I must ensure in my prj.conf file that CONFIG_I2C=y is present, to enable Zephyr RTOS&amp;#39; in-tree I2C driver and subsystem.&amp;nbsp; But this reference to I2C does not know any details about which I2C peripheral(s) I enable elsewhere in device tree and / or dot overlay files.&amp;nbsp; Kconfig does not generally know or care about the pin assignments or other hardware details, but rather just the code base to support those given peripherals.&lt;/p&gt;
&lt;p&gt;Kconfig as you may know can enable a lot of things that are not hardware:&amp;nbsp; floating point and complex math libraries, printk and printf family functions, and third party libraries which are designed with Kconfig written among their library sources.&lt;/p&gt;
&lt;p&gt;Device Tree Source is in a manner somewhat hardware agnostic too:&amp;nbsp; DTS supports pretty much all microcontroller architectures for which there are developers willing to write DTS files.&amp;nbsp; The details of going from device tree source to controller-specific-C-code are, I believe, captured in the hardware abstraction layer (HAL) sources which&amp;nbsp; many chip and SoC makers provide.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regarding that video on device tree, the recorded class given by Marti Bolivar, at around the28 minute mark there is a key example of device tree source flexiblity.&amp;nbsp; Mr. Bolivar is teaching with a sample Nordic app which involves an I2C/SPI ready sensor.&amp;nbsp; He builds the project with a particular I2C peripheral enabled in his device tree file.&amp;nbsp; He demos that code.&amp;nbsp; Then he changes just a couple of device tree lines to make that DTS &amp;quot;node&amp;quot; point to the target microcontroller&amp;#39;s SPI peripheral, with one and the same map-able GPIOS now carrying SPI signals.&amp;nbsp; He rebuilds the project -- without changing any C code -- and now the sensor is communicating via SPI.&amp;nbsp; Pretty slick!&lt;/p&gt;
&lt;p&gt;Granted, one has to know a good amount to set up a project both in hardware and software to enjoy this kind of flexibility.&amp;nbsp; But so far I really like how Device Tree Source goes so far to encapsulate hardware specifics.&amp;nbsp; This makes a project&amp;#39;s C code cleaner and more portable, at least to the extent that a developer cares about these coding practices.&lt;/p&gt;
&lt;p&gt;So your posted question caught my eye because I was just here a couple months ago, with the same question.&amp;nbsp; I got some good help from Devzone (also community forum at Jared Wolff&amp;#39;s embedded development site).&amp;nbsp; I am also on the cusp of writing device tree files for a custom board myself.&amp;nbsp; So far I have just done the more modest .overlay files to amend and tweak already supported dev boards.&amp;nbsp; I think however that device tree source (its own project too - &lt;a href="https://www.devicetree.org/"&gt;https://www.devicetree.org/&lt;/a&gt;) will be your friend in situations where you must modify button, GPIO and related hardware configurations.&lt;/p&gt;
&lt;p&gt;Sorry to be long winded, John!&amp;nbsp; Keep 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: MCUboot on the Thingy91</title><link>https://devzone.nordicsemi.com/thread/338254?ContentTypeID=1</link><pubDate>Tue, 09 Nov 2021 18:32:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45260034-1341-45bb-8744-6fd61b63e93f</guid><dc:creator>John_Turner</dc:creator><description>&lt;p&gt;Hi Ted,&lt;/p&gt;
&lt;p&gt;Thanks for the detailed response. I&amp;#39;ll read through it later today in detail and certainly have a look at the videos.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I did find what I was looking for in this directory, &amp;quot;C:\ncs\v1.7.1\bootloader\mcuboot\boot\zephyr\boards&amp;quot;.&lt;/p&gt;
&lt;p&gt;There are configuration files for each of the MCU used on the Thingy91 (&amp;quot;thingy91_nrf52840.conf&amp;quot; and &amp;quot;thingy91_nrf9160.conf&amp;quot;) and within each is a section that defines the serial recovery GPIO, level etc.. In this case I have a Button attached to SIO_39 on the nRF52840 that pulls the line low when pressed.&lt;/p&gt;
&lt;p&gt;-----&lt;/p&gt;
&lt;p&gt;# MCUboot serial recovery&lt;br /&gt;CONFIG_GPIO=y&lt;br /&gt;CONFIG_MCUBOOT_SERIAL=y&lt;br /&gt;CONFIG_BOOT_SERIAL_CDC_ACM=y&lt;br /&gt;CONFIG_BOOT_SERIAL_DETECT_PORT=&amp;quot;GPIO_1&amp;quot;&lt;br /&gt;CONFIG_BOOT_SERIAL_DETECT_PIN=7&lt;br /&gt;CONFIG_BOOT_SERIAL_DETECT_PIN_VAL=0&lt;/p&gt;
&lt;p&gt;-----&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also using Segger as a development environment and the settings are accessible through the &amp;quot;mcuboot_menuconfig&amp;quot; configuration menu.&lt;/p&gt;
&lt;p&gt;JT&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUboot on the Thingy91</title><link>https://devzone.nordicsemi.com/thread/338028?ContentTypeID=1</link><pubDate>Mon, 08 Nov 2021 23:40:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4622d0d0-8a9a-40e5-ab41-1154c10455ba</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello John,&lt;/p&gt;
&lt;p&gt;Are you writing your application with a basis or dependency on Nordic Semi&amp;#39;s sdk-nrf code base?&amp;nbsp; I may not be developing with the most commonly used set of tools (Linux command line, Python, west, cmake and the &amp;#39;set up manually&amp;#39; stuff).&amp;nbsp; But this has given me an insight early on to the Device Tree Source or &amp;#39;dts&amp;#39; files for Zephyr supported boards.&amp;nbsp; Are you familiar with the dts files for the Thingy91_nrf9160?&amp;nbsp; In my build environment I find these files in [west_workspace]/nrf/boards/arm/thingy91_nrf9160.&lt;/p&gt;
&lt;p&gt;There are several files in this Nordic board provided directory, both dts and Kconfig files, and a couple more.&amp;nbsp; Can be a little overwhelming, but one thing I have learned is that a larger or &amp;#39;parent&amp;#39; .dts file can have just small parts amended to it, or over-written, by creating a file in your application&amp;#39;s area, with the extension &amp;quot;.overlay&amp;quot;.&lt;/p&gt;
&lt;p&gt;Forgive me if I offer info you already know.&amp;nbsp; Dot overlay files are themselves written in Device Tree Source.&amp;nbsp; I&amp;#39;ve managed to achieve changes simple as moving one I/O pin assignment over, or change the sample app&amp;#39;s default I2C clock rate on a particular I2C peripheral instance, by creating along side my app sources a directory named `boards`, and within it a file named `thingy91_nrf9160.overlay`.&lt;/p&gt;
&lt;p&gt;If by chance your application requires you to build in a non-secure way -- several Nordic sample apps require this -- you will want to create a file with your board name followed by &amp;#39;ns&amp;#39; in the basename, e.g.:&amp;nbsp; `thingy91_nrf9160ns.overlay`.&amp;nbsp; DTS files have a syntax for including other .dts and .overlay files, so when you have a pin assignment or other hardware change you would like to effect in both secure and non-secure board configurations, you can create a file with a basename of your choosing, and have the board-name-specific overlays include the common one.&amp;nbsp; There is already an example of this practice in Nordic Semi sdk-nrf v1.6.1 `nrf/boards/arm/thingy91_nrf9160` directory.&lt;/p&gt;
&lt;p&gt;I think I shared this Nordic Youtube video tutorial link in a prior post where I had questions, but this gave me some good initial understanding and help on which questions to ask next:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; *&amp;nbsp; &lt;a href="https://www.youtube.com/watch?v=sWaxQyIgEBY"&gt;www.youtube.com/watch?v=sWaxQyIgEBY&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I happen to be developing with Zephyr RTOS&amp;#39; 2.6.0 release, not the cutting edge, so this documentation at the Zephyr Project site has also helped me grasp how to connect more traditional C code with device tree nodes:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; *&amp;nbsp; &lt;a href="https://docs.zephyrproject.org/2.6.0/reference/devicetree/api.html"&gt;https://docs.zephyrproject.org/2.6.0/reference/devicetree/api.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Still working to wrap my mind around these programming languages and Zephyr design features -- DTS and Kconfig -- but am also now able to build some stuff beyond the basics.&amp;nbsp; If I can do so there must be hope!&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>