<?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>Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118619/troubles-to-use-fota-nvs-lib</link><description>Hi everyone, 
 
 I working on a projetc that i have to use the NVS lib to store several user data on external flash, but i need put FOTA capability in this firmware and when i&amp;#180;m included the needed configs on prj.conf and created the thread that process</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Feb 2025 09:22:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118619/troubles-to-use-fota-nvs-lib" /><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/523835?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 09:22:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80cb1a80-2ae4-4919-86d6-91d0b76f8bf8</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Felipe,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s good&amp;nbsp;we caught one issue. I will wait for your update.&lt;br /&gt;Best of luck with both the urgent issue and this one.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/523775?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2025 22:14:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fbc4b0a-8158-4116-9922-b83d69330345</guid><dc:creator>Felipe Dantas</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="9456" url="~/f/nordic-q-a/118619/troubles-to-use-fota-nvs-lib/523213"]Have you made sure to apply your overlay to &lt;strong&gt;both&lt;/strong&gt; the bootloader and the application?[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t know I needed an overlay for the bootloader and another for the application, nor do I know how to do this at the moment. That must be the problem then. I don&amp;#39;t have the files you asked me for right now because I had to change my focus to other more urgent issues in the project, but I&amp;#39;ll post them here as soon as possible. In any case, you&amp;#39;ve already given me a great starting point. Thanks for this!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Felipe Dantas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/523213?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2025 09:55:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baa13c52-22b4-4d9a-a322-7adc124b7c32</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Felipe,&lt;/p&gt;
[quote user="Felipe Dantas"]&lt;blockquote&gt;&lt;div&gt;&lt;p&gt;&lt;span&gt;- Custom board with fota: don´t work propertly. external flash memory&amp;nbsp;mx25r6435f are not recognized by spim drive like yoou can see in firt line of application log.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;
&lt;p&gt;Above i described all 4 scenaries that we have now.&lt;/p&gt;[/quote]
&lt;p&gt;I read the text you posted. However, as I have explained before, the error message appears to be from the bootloader. That does not immediately mean that the application cannot access the external flash. When trying to figure out an issue, details are very important.&lt;/p&gt;
[quote user="Felipe Dantas"]So, being more clarify about your question: In any case, if memory aren´t recognized, any nvs funtion like nvs_init(), nvs_read(), nvs_write() will return error, but the rest of application still running.[/quote]
&lt;p&gt;Alright. Then it seems the application&amp;nbsp;also cannot access external flash either, when DFU is enabled.&lt;/p&gt;
&lt;p&gt;Have you made sure to apply your overlay to &lt;strong&gt;both&lt;/strong&gt; the bootloader and the application?&lt;/p&gt;
&lt;p&gt;Could you please share the compiled zephyr.dts and .config file from MCUboot and the application? They are under:&lt;/p&gt;
&lt;p&gt;- &amp;lt;build dir&amp;gt;/mcuboot/zephyr&lt;br /&gt;- &amp;lt;build dir&amp;gt;/&amp;lt;application name&amp;gt;/zephyr&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/522882?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2025 14:04:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3e9cc86-8d40-4156-9265-fe2221c8d300</guid><dc:creator>Felipe Dantas</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;I think that this is you want to know:&lt;/p&gt;
[quote userid="135458" url="~/f/nordic-q-a/118619/troubles-to-use-fota-nvs-lib/521796"]&lt;p&gt;&lt;span&gt;Work conditions:&lt;br /&gt;&lt;br /&gt;- DK and firmware without fota: works normally. can read and write on external flash memory&amp;nbsp;mx25r6435f normally.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- DK and firmware with fota: works normally. can read and write on external flash memory&amp;nbsp;mx25r6435f normally and make fota update throug nrfCloud.&lt;br /&gt;&lt;br /&gt;- Custom boar without fota:&amp;nbsp;works normally. can read and write on external flash memory&amp;nbsp;mx25r6435f normally.&lt;br /&gt;&lt;br /&gt;- Custom board with fota: don´t work propertly. external flash memory&amp;nbsp;mx25r6435f are not recognized by spim drive like yoou can see in firt line of application log.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Above i described all 4 scenaries that we have now.&lt;br /&gt;&lt;br /&gt;So, being more clarify about your question: In any case, if memory aren&amp;acute;t recognized, any nvs funtion like nvs_init(), nvs_read(), nvs_write() will return error, but the rest of application still running.&lt;/p&gt;
&lt;p&gt;I&amp;acute;ll open a private case as soon as possible. Thanks for your help.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Felipe&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/522858?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2025 12:57:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb0a0838-eb33-49ed-9f97-3138d25b1080</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Felipe,&lt;/p&gt;
&lt;p&gt;What about this case?&lt;/p&gt;
[quote user="vthieu"]For the with-FOTA&amp;nbsp;case, does the application work? Like I mentioned, the log suggests that the error is in the bootloader stage,&amp;nbsp;but the application boot up still works. I want to know if the application can access the external flash normally.[/quote]
&lt;p&gt;Can the application access the external flash and use it normally?&lt;/p&gt;
&lt;p&gt;Could you please also open a private case for hardware review? Please mention this case in that new case.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/522321?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 01:22:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91ef0d18-7e69-4685-9ac2-65fe6eb93c0e</guid><dc:creator>Felipe Dantas</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;To use the&amp;nbsp;&lt;span&gt;mx25r6435f, i followed the steps on page in the link below (Exept the initial step &amp;quot;Programming board controller&amp;quot; cause i&amp;acute;m in custom boar):&lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/nrf/app_dev/device_guides/nrf91/nrf9160_external_flash.html"&gt;https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/nrf/app_dev/device_guides/nrf91/nrf9160_external_flash.html&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;So, i include nvs.h lib and use him following his documentation in the link below:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/storage/nvs/nvs.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/storage/nvs/nvs.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;About the hardware design review case, we never had yet.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;&lt;br /&gt;Felipe Dantas&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/521902?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2025 11:34:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8108ec6d-32d9-4c59-a033-2fe0c91fbaa8</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Felipe,&lt;/p&gt;
[quote user="Felipe Dantas"]- Custom boar without fota:&amp;nbsp;works normally. can read and write on external flash memory&amp;nbsp;mx25r6435f normally.&lt;br /&gt;&lt;br /&gt;- Custom board with fota: don´t work propertly. external flash memory&amp;nbsp;mx25r6435f are not recognized by spim drive like yoou can see in firt line of application log.&amp;nbsp;[/quote]
&lt;p&gt;How is the read and write on external flash done in your test no-FOTA case? In particular, I want to know if&amp;nbsp;you are using Zephyr driver which initialize before main() even starts.&lt;/p&gt;
&lt;p&gt;For the with-FOTA&amp;nbsp;case, does the application work? Like I mentioned, the log suggests that the error is in the bootloader stage,&amp;nbsp;but the application boot up still works. I want to know if the application can access the external flash normally.&lt;/p&gt;
&lt;p&gt;This will help tell if the external flash isn&amp;#39;t started early enough.&lt;/p&gt;
&lt;p&gt;By the way, have you had a hardware design review case with us yet?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/521796?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2025 16:42:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16a97c27-6e30-4874-8afc-52f85331141f</guid><dc:creator>Felipe Dantas</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;So, about ic model, i think that i understood somethink wrong. On my initial post, i&amp;acute;ve said that i&amp;acute;ve used the same parts used in 9160DK, that have an&amp;nbsp;mx25r6435f IC flash memory and this is are declared on code, but you and&amp;nbsp;&lt;span&gt;Simon asked me the same think. The information that you and Simon are needing is other think? Sorry, i really didnt&amp;acute;t understood.&lt;br /&gt;&lt;br /&gt;We&amp;acute;re in pre production stage, so i&amp;acute;ve some like 10 bords in lab for tests now. About the eletrical connectios, are good. As i said, the firmware work normally without the&amp;nbsp;code pieces needed by FOTA scheme. I can write and read normally in the&amp;nbsp;mx25r6435, booth my board and in dk.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But the most stranger thing here is that the firmware with fota work perfectly on dk, but not in mine, despiste that i&amp;acute;ve declared the correct pinout on overlay file like you can see in my code (and if is wrong, this firmware wouldn&amp;acute;t in any condition and any board).&lt;br /&gt;&lt;br /&gt;So, trying be a little more clearer:&lt;br /&gt;&lt;br /&gt;- IC flash memory model(i think):&amp;nbsp;mx25r6435f&lt;br /&gt;&lt;br /&gt;Work conditions:&lt;br /&gt;&lt;br /&gt;- DK and firmware without fota: works normally. can read and write on external flash memory&amp;nbsp;mx25r6435f normally.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- DK and firmware with fota: works normally. can read and write on external flash memory&amp;nbsp;mx25r6435f normally and make fota update throug nrfCloud.&lt;br /&gt;&lt;br /&gt;- Custom boar without fota:&amp;nbsp;works normally. can read and write on external flash memory&amp;nbsp;mx25r6435f normally.&lt;br /&gt;&lt;br /&gt;- Custom board with fota: don&amp;acute;t work propertly. external flash memory&amp;nbsp;mx25r6435f are not recognized by spim drive like yoou can see in firt line of application log.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This seems to me more like a competition for pins going on behind the scenes by something in Zephyr or something called by the libraries included by FOTA.&lt;br /&gt;&lt;br /&gt;So... is it for now.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Felipe&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/521748?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2025 14:13:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c62bd6cd-c96b-426d-bbea-528a52f7e2b5</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Felipe,&lt;/p&gt;
&lt;p&gt;What model of external flash device do you have on&amp;nbsp;your custom board? Like Simon said, the SPI_NOR library isn&amp;#39;t able to read the JEDEC ID from the external flash correctly.&lt;/p&gt;
&lt;p&gt;It could be a hardware issue. For&amp;nbsp;that, let&amp;#39;s go through the usual&amp;nbsp;checks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Is the physical connection between the two devices intact?&lt;/li&gt;
&lt;li&gt;Are the chosen pins on the nRF9160 right for the purpose? I.e., do they have any usage restriction?&lt;/li&gt;
&lt;li&gt;Have this been tested with&amp;nbsp;multiple boards, or just one?&lt;/li&gt;
&lt;li&gt;Does the board design ensure that the external flash is fully powered and ready before the nRF9160 starts communicating with it?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From the log, it seems that the error is thrown from the bootloader. Does&amp;nbsp;the application have any features with the external flash? If so, do they work normally?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/521527?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2025 11:37:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3afc2d63-6cfe-4491-b76f-0242d1800c4f</guid><dc:creator>Felipe Dantas</dc:creator><description>&lt;p&gt;Hi Simon,&lt;br /&gt;&lt;br /&gt;Of course! As said, i have an external flash on board, and like you can see on my code, this is an&amp;nbsp;&lt;span&gt;mx25r6435.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Felipe&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Troubles to use FOTA + NVS Lib</title><link>https://devzone.nordicsemi.com/thread/521523?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2025 11:26:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1654c1c-3524-403b-845e-232dee1590e3</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You say this only occurs on a custom board. The error message here points to the SPI_NOR library not being able to communicate with the external flash memory. Can you confirm whether you have an external NOR flash on your custom board or not? The application expects that you have an mx25r6435f on the board that&amp;#39;s connected to the device.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>