<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Adding MCUBOOT and QSPI device to DTS causes no boot</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/116693/adding-mcuboot-and-qspi-device-to-dts-causes-no-boot</link><description>I am attempting to get the SMP server sample to work on some custom hardware in order to run a BLE FOTA. I&amp;#39;m using NCS version 2.6.1. 
 I&amp;#39;m able to build the SMP server sample successfully using both versions of the custom hardware DTS. 
 When I comment</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Dec 2024 10:04:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/116693/adding-mcuboot-and-qspi-device-to-dts-causes-no-boot" /><item><title>RE: Adding MCUBOOT and QSPI device to DTS causes no boot</title><link>https://devzone.nordicsemi.com/thread/515063?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2024 10:04:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4071f3c-c9c4-4478-99e2-40031f5fd438</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Looks to me that CONFIG_REGULARTOR=y is what you needed. Glad to hear that!&lt;/p&gt;
&lt;p&gt;W.r.t transitioning to QSPI, which GPIOs had you set your peripheral up to use? More specifically: which GPIOs are qspi_default and qspi_sleep set up to use through pinctrl-0 and 1?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1734343414092v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding MCUBOOT and QSPI device to DTS causes no boot</title><link>https://devzone.nordicsemi.com/thread/514871?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2024 10:27:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9033906-4d51-4326-b97a-901a4ab3b7e3</guid><dc:creator>frankenboom</dc:creator><description>&lt;p&gt;Update: adding CONFIG_REGULATOR=y to the mcuboot child image .conf appears to have fixed the issue with the flash chip not having power before communication is attempted - the board now boots without manual intervention.&lt;br /&gt;&lt;br /&gt;It seems the remaining issue is to experiment with transitioning to QSPI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding MCUBOOT and QSPI device to DTS causes no boot</title><link>https://devzone.nordicsemi.com/thread/514863?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2024 10:12:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8687a6b7-9460-4660-8749-b346aad087ee</guid><dc:creator>frankenboom</dc:creator><description>&lt;p&gt;Hi Andreas, &lt;br /&gt;&lt;br /&gt;I can provide some snippets. Generally speaking, the regulator is always connected to the battery. The 3v3 rail is then enabled with a GPIO. &lt;br /&gt;&lt;br /&gt;Here you can see REG_EN net (pulled down) connected to EN2, which controls OUT2, which is the 3v3 rail.&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2024_2D00_12_2D00_13-at-2.02.36-AM.png" /&gt;&lt;/p&gt;
&lt;p&gt;We are using a FANSTEL BC840M as the module. Pin 26 (on the NRF SOC) controls REG_EN.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2024_2D00_12_2D00_13-at-2.04.08-AM.png" /&gt;&lt;br /&gt;Here is the flash chip. VCC pin is connected to 3V3 output of the regulator. Note that the pullups for CS, Write protect/IO2, and RESET/IO3 are connected to this same rail. &lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2024_2D00_12_2D00_13-at-2.09.23-AM.png" /&gt;&lt;/p&gt;
&lt;p&gt;After a bit more digging, it sounds like a method mentioned in this ticket may he helpful? &lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/116268/mcuboot-hold-gpio-on-boot"&gt;devzone.nordicsemi.com/.../mcuboot-hold-gpio-on-boot&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding MCUBOOT and QSPI device to DTS causes no boot</title><link>https://devzone.nordicsemi.com/thread/514179?ContentTypeID=1</link><pubDate>Tue, 10 Dec 2024 09:12:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a359581-5e3e-4c75-852b-b0550b596a24</guid><dc:creator>AHaug</dc:creator><description>[quote user="frankenboom"]- I must reset the board while manually applying voltage to the rail powering the flash chip - it appears that, even though the vin-supply is added to the DT, whatever driver(?) is active in the bootloader does NOT enable the regulator. I consistently need to manually apply power to the flash chip&amp;#39;s VDD in order for the application to run. &lt;strong&gt;Is there a way to make sure that the bootloader enables the regulator before attempting any flash transactions? What about for the QSPI driver, which does not have this property?&lt;/strong&gt;[/quote]
&lt;p&gt;If you have an external regulator, you would have to power this in the bootloader before you get access to the flash chip. I had a chat with one of our hardware engineers and we concluded we might need a schematic to answer this. Could you either upload it here if you&amp;#39;re comfortable with uploading it publicly or create a new private case and refer to this case as a reference with the schematic?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding MCUBOOT and QSPI device to DTS causes no boot</title><link>https://devzone.nordicsemi.com/thread/514079?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 15:22:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8066b4d5-0e9d-4184-872c-c42404e85732</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="frankenboom"] &lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;Can you point me to where I can edit the driver for the flash chip if this functionality is not added by default?&lt;/strong&gt;[/quote]
&lt;p&gt;For your&amp;nbsp;first question you should be able to add this here:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/baa4ee7ebd5d885119d6d196d62c1ca1e6af5841/drivers/flash/nrf_qspi_nor.c"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/baa4ee7ebd5d885119d6d196d62c1ca1e6af5841/drivers/flash/nrf_qspi_nor.c&lt;/a&gt;&amp;nbsp;but I have some doubts w.r.t the support for changing qspi pins during runtime in Zephyr RTOS&lt;/p&gt;
[quote user="frankenboom"]CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y seems to require that a QSPI device be present in the DTS[/quote]
&lt;p&gt;Yes, atleast previously this config implied (harder than select) that the QSPI driver should be enabled and a QSPI device is what that should&amp;#39;ve been used. I don&amp;#39;t see the imply now &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/baa4ee7ebd5d885119d6d196d62c1ca1e6af5841/drivers/flash/nrf_qspi_nor.c"&gt;in 2.8.0&lt;/a&gt;, but it&amp;#39;s still designed around a QSPI device. The approach you mention with using configurations in smp_svr is what I would recommend you do, and if you get stuck have a look at any nRF91-based DFU samples or nRF7002DK (7002 + 5340) which uses SPI to communicate with the external flash.&lt;/p&gt;
[quote user="frankenboom"]Is there a way to make sure that the bootloader enables the regulator before attempting any flash transactions? What about for the QSPI driver, which does not have this property?[/quote]
&lt;p&gt;I will have to ask the devs about this to see if I can find someone who has an answer. I will get back to you&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding MCUBOOT and QSPI device to DTS causes no boot</title><link>https://devzone.nordicsemi.com/thread/513943?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 02:30:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbc55311-b30c-4fbc-8a38-1247fd4b67a4</guid><dc:creator>frankenboom</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;Thanks for pointing me in the right direction. It does appear that any error with reading the JEDEC ID of the flash chip while in bootloader will cause the bootloader not to jump to app. Here are some of the things I have done:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;- Added configurations to the mcuboot child image configuration to enable the clock from the internal RC oscillator instead of an external crystal which my custom HW does not have. These configurations were enabled in the main application configuration but I did not realize the same would need to be configured for the child image, which makes sense in hindsight.&lt;/p&gt;
&lt;p&gt;- Used the JESD216 sample to read out the correct JEDEC ID and SFDP array. These have been added to the updated DTS. I&amp;#39;ve confirmed as well that these settings in the DTS are working correctly with the chip (I set CONFIG_SPI_NOR_SFDP_DEVICETREE=Y)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;- Transitioned the driver for the external flash in the DT back to normal SPI, for two reasons: &lt;br /&gt;-- The compatible &amp;quot;nordic,qspi-nor: does not have a vin-supply property. The flash chip is powered by a regulator which must be switched on prior to any flash transactions. &lt;br /&gt;-- The flash chip I&amp;#39;m using will switch the functionality of one pin from HOLD or RESET to IO3 when configured with a certain register to use QSPI instead of the default SPI. I&amp;#39;m not sure whether the QSPI driver is able to account for this, so to be sure I eliminated this as a variable. I assume if this register is not configured, any attempt at a transaction that would switch the state of this pin would result in the chip being reset / blocked for further transactions. &lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;Can you point me to where I can edit the driver for the flash chip if this functionality is not added by default?&lt;/strong&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2024_2D00_12_2D00_08-at-6.24.43-PM.png" /&gt;&lt;br /&gt;&lt;br /&gt;- I must reset the board while manually applying voltage to the rail powering the flash chip - it appears that, even though the vin-supply is added to the DT, whatever driver(?) is active in the bootloader does NOT enable the regulator. I consistently need to manually apply power to the flash chip&amp;#39;s VDD in order for the application to run. &lt;strong&gt;Is there a way to make sure that the bootloader enables the regulator before attempting any flash transactions? What about for the QSPI driver, which does not have this property?&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;- Added some of the configuration options from &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/111437/nrf5340dk-mcuboot-sample-smp_srv-spi-ext-flash"&gt;this forum post&lt;/a&gt; to enable OTA with SPI instead of QSPI. Also, trying to enable the configuration option CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y seems to require that a QSPI device be present in the DTS to build successfully&lt;strong&gt;, &lt;/strong&gt;so I manually ported over some of the config options from the SMP_SVR sample.&lt;strong&gt; &lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;With the above changes, I&amp;#39;m able to run a full FOTA over BLE on my custom hardware, but still need help on the open questions. Also, in general, sifting through all the config options and their possible impacts on other config options and other application code seems opaque and difficult to disentangle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding MCUBOOT and QSPI device to DTS causes no boot</title><link>https://devzone.nordicsemi.com/thread/513585?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2024 09:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:675dfa54-7297-4a15-87a2-63b05d6e8192</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve spent some time looking into this and I do believe that the issue might lie with this:&lt;/p&gt;
[quote user=""]The setting for the Winbond flash chip use some of the defaults from the mxr flash chip that comes on the devkit - these are eventually going to be corrected, but I don&amp;#39;t believe they should affect anything until mcuboot tries to store an image on the external flash, is this correct?[/quote]
&lt;p&gt;After discussing this question, initialization of some peripherals do occur during bootup, so the fact that you don&amp;#39;t get to bootup with the wrongly configured Winbond flash might cause your app to get stuck there during initialization.&lt;/p&gt;
&lt;p&gt;I suggest you exclude this reason before we move into spotting the difference between the two confiugrations&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check your firmware with a nRF5340DK using the mx25 and see if you get past boot?
&lt;ol&gt;
&lt;li&gt;If this fails, could you check with bootup with a minimal sample that uses your configuration?&lt;/li&gt;
&lt;li&gt;If this succeeds, could you try to define the Winbond device with the correct parameters, if you&amp;#39;ve not done that already since you raised the ticket?&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let me know if this is something that works for you&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding MCUBOOT and QSPI device to DTS causes no boot</title><link>https://devzone.nordicsemi.com/thread/512871?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2024 02:06:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68b4c321-0dd4-467e-921b-75b4820ab03b</guid><dc:creator>frankenboom</dc:creator><description>&lt;p&gt;Hi Andreas, thanks for the reply. &lt;/p&gt;
&lt;p&gt;I should have clarified - the sections in the linked DTS files are where I believe the partitions are being declared on the external device. See the screenshot.&amp;nbsp;&lt;br /&gt; &lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2024_2D00_12_2D00_01-at-5.34.53-PM.png" /&gt;&lt;br /&gt;I&amp;#39;ve narrowed down the problem further, though. Using the DTS file named &lt;code&gt;v5_0_prod_board_narrowed.dts&lt;/code&gt; in the zip below, the no-boot condition occurs when the line&lt;br /&gt;&amp;quot;&lt;code&gt;nordic,pm-ext-flash = &amp;amp;w_25&lt;/code&gt;&amp;quot; is not commented. Commenting this line allows the application and bootloader to work as expected.&lt;br /&gt;&lt;br /&gt;Attached are the build logs using these two variations of the DTS file, named accordingly. &lt;br /&gt;&lt;br /&gt;As for the device logs, the non-boot case does not generate any output over RTT. Also, the working case does not appear to generate any bootloader output over RTT. I added some device logs from the working sample - I added the &amp;quot;test6&amp;quot; print statement to the default app. &lt;br /&gt;&lt;br /&gt;I also attached some build output files, related to the configuration and the partition manager. There are significant differences in the partitions.yml files. &lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ext_5F00_flash_5F00_comment.zip"&gt;devzone.nordicsemi.com/.../ext_5F00_flash_5F00_comment.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding MCUBOOT and QSPI device to DTS causes no boot</title><link>https://devzone.nordicsemi.com/thread/512116?ContentTypeID=1</link><pubDate>Tue, 26 Nov 2024 13:07:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3adfca8c-b173-478f-a0ea-39d6145dfbff</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you also upload build logs (to see if there&amp;#39;s any warnings that should not be ignored) and device logs (preferably with logs from both the bootloader and app even though I don&amp;#39;t expect to see any logs from the app)?&lt;/p&gt;
[quote user=""]Attached are the two DTS files. The v5_0_test_board.dts is the one that works and has some sections commented. the v5_0_prod_board.dts has these sections uncommented.[/quote]
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1732626491059v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Am I looking in the wrong place w.r.t the commented/uncommented differences in the two files you&amp;#39;ve uploaded? Or your statement w.r.t what parts are commented/uncommented are not related to the qspi device?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>