<?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>Configuring power control pin for external flash (MX25R64)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95530/configuring-power-control-pin-for-external-flash-mx25r64</link><description>Hi. 
 Problem description 
 I&amp;#39;m currently using the MX25R64 as an external flash to perform FOTA over SPI on a custom board employing the nRF9160, which is working very well for the most part. However, I have some issues correctly configuring the power</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 20 Jan 2023 15:19:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95530/configuring-power-control-pin-for-external-flash-mx25r64" /><item><title>RE: Configuring power control pin for external flash (MX25R64)</title><link>https://devzone.nordicsemi.com/thread/405883?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2023 15:19:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c64e5c9-1d7d-4a26-8298-bd53f4449996</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;You would need to create a device driver with a Kconfig which would enable the driver in Zephyr. Then, you could use mcuboot.conf in a child image configuration. This would require some changes in CMakeLists and Kconfig. These changes could be added to the bottom of these files making them maintainable. There are some online resources for which I hope that they could be useful for you and which you might want to look at -&amp;nbsp;&lt;a href="https://blog.golioth.io/adding-an-out-of-tree-sensor-driver-to-zephyr/"&gt;first blog&lt;/a&gt;,&amp;nbsp;&lt;a href="https://interrupt.memfault.com/blog/building-drivers-on-zephyr"&gt;second blog&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://www.zephyrproject.org/how-to-build-drivers-for-zephyr-rtos/"&gt;Zephyr documentation&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuring power control pin for external flash (MX25R64)</title><link>https://devzone.nordicsemi.com/thread/405712?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2023 14:32:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fe62880-9760-4d28-ab5f-68a24439118e</guid><dc:creator>Erlend Isachsen</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;I will look into the second option. When editing MCUBoot&amp;#39;s code, do you know if this is possible to do this without changing MCUBoot&amp;#39;s &amp;#39;main.c&amp;#39; in the SDK? What I&amp;#39;m thinking of specifically is something along the lines of how Simon configures MCUboot as a child image in this sample: &lt;a href="https://github.com/simon-iversen/sdk-nrf/tree/d1a11f2c39e3b8fb0af7652e7e720626f0e1298e/samples/nrf9160/http_update/application_update"&gt;nRF9160: HTTP application update using the nRF9160DK&amp;#39;s external flash&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuring power control pin for external flash (MX25R64)</title><link>https://devzone.nordicsemi.com/thread/405698?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2023 13:58:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7414a232-0251-4948-9a97-ff55d3594b27</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;There are 2 options that you could consider.&amp;nbsp;&lt;br /&gt;First option is to write your custom code for accessing GPIO and set it as&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/kernel/drivers/index.html#initialization-levels"&gt;pre_kernel&lt;/a&gt;. In other words, you could modify or add device driver and initialize it as pre_kernel. You can read more in&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/kernel/drivers/index.html#device-driver-model"&gt;Zephyr device driver model&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;The second option is to change/edit MCUboot code manually in order to set the pin at the start. You could do this by adding the function at the beginning of main.c in MCUboot. You could later unset the pin when MCUboot is done and if this is needed.&lt;br /&gt;Out of these 2 options, the second one would be recommended.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuring power control pin for external flash (MX25R64)</title><link>https://devzone.nordicsemi.com/thread/405406?ContentTypeID=1</link><pubDate>Wed, 18 Jan 2023 09:14:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a23892ae-cb55-405a-998d-937152e4bea4</guid><dc:creator>Erlend Isachsen</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Apologies for the delay on this matter. I tried removing GPIO_PULL_DOWN as well as removing the power control pin 2 entriely from the .dts configuration, but both run into the same problem: &amp;quot;Device id ff ff ff does not match config c2 28 17&amp;quot; when trying to read from the external flash. Due to the HW design of the board I can&amp;#39;t rely on the pin passively floating low, so I need the nRF9160 to actively pull the pin down before MCUBoot attempts to read the external flash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuring power control pin for external flash (MX25R64)</title><link>https://devzone.nordicsemi.com/thread/404763?ContentTypeID=1</link><pubDate>Fri, 13 Jan 2023 10:25:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ad7ba81-b7d9-4eb3-9fff-62e279f362a5</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Have you tried removing GPIO_PULL_DOWN from your GPIO configuration?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuring power control pin for external flash (MX25R64)</title><link>https://devzone.nordicsemi.com/thread/404569?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2023 13:26:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fb1ea92-745d-4131-b8d0-1b7f918ad115</guid><dc:creator>Erlend Isachsen</dc:creator><description>&lt;p&gt;Thanks for the advice. I moved the power control pin outside the SPI configuration in the &amp;quot;...board_common.dts&amp;quot; file and tried to configure it independently with the &amp;#39;GPIO_PULL_DOWN&amp;#39; flag set, but I couldn&amp;#39;t quite get it to work (Setting the power control pin (2) low turns the power domain/flash ON with this board). When building the application with the edited .dts file, MCUBoot can&amp;#39;t communicate with the flash and is stuck in a boot loop. However, I&amp;#39;m not sure if I&amp;#39;ve set it up correctly. I would really appreciate if you could check if my GPIO on pin 2 is configured correctly. I also attached parts of the error log when trying to boot.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/22_5F00_1011_5F00_AA_5F00_board_5F00_edit_5F00_and_5F00_log.zip"&gt;devzone.nordicsemi.com/.../22_5F00_1011_5F00_AA_5F00_board_5F00_edit_5F00_and_5F00_log.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuring power control pin for external flash (MX25R64)</title><link>https://devzone.nordicsemi.com/thread/404379?ContentTypeID=1</link><pubDate>Wed, 11 Jan 2023 14:57:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c50591a-4351-4147-ab2f-4c05c116b6b3</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;You don&amp;#39;t need to add your GPIO 2 pin to the SPI configuration in your dts file. You could consider using GPIO 2 pin for controlling power of external flash directly from nRF91. Additionally, connecting GPIO pin with pull-up resistor to VDD would allow you to have your flash power ON until you switch it to OFF in your application.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuring power control pin for external flash (MX25R64)</title><link>https://devzone.nordicsemi.com/thread/404188?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2023 19:26:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7579d441-d67a-41b1-ab9b-4822cf05dc4e</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I&amp;#39;ll look into it tomorrow.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>