<?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>Strings with Flashlog</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113533/strings-with-flashlog</link><description>Hi all, 
 I am hoping to eventually integrate the crashlog functionality, but prior to this, I wanted to test the basic functionality with the flashlog. I have looked through posts like this and this , but I am still not able to understand the flashlog</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Aug 2024 17:17:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113533/strings-with-flashlog" /><item><title>RE: Strings with Flashlog</title><link>https://devzone.nordicsemi.com/thread/496859?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2024 17:17:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23bb0922-4458-4f5b-a715-dc5c9465dd14</guid><dc:creator>jspear</dc:creator><description>&lt;p&gt;Einar,&lt;/p&gt;
&lt;p&gt;That makes a lot of sense and I appreciate the clarification! I&amp;#39;ll look into using the RAM buffer as a method for error analysis.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Strings with Flashlog</title><link>https://devzone.nordicsemi.com/thread/496790?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2024 10:48:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27377c38-f3e3-443e-b383-5849b466296f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Regarding flash logging you can look at this sample that a colleague of me made and attached to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/86890/nrf52840-sdk16---nrf_fstorage-addr_is_within_bounds-p_fs-dest-len-check-failed-in-nrf_fstorage_write-with-value-0x10/366720"&gt;this post&lt;/a&gt; (this does not use crash log).&lt;/p&gt;
&lt;p&gt;Honestly, I do not recall seeing many questions about the crashlog feature in the logger module and I believe it is very little used (perhaps related to what I wrote before). You can see how it is used in the CLI examples, but that is the only reference we have for it.&lt;/p&gt;
&lt;p&gt;I would suggeest a different approach though, as mentionned before. There are cases where writing to flash after an error is simply not possible. This is also the case after for instance a WDT has timed out. In that case you&amp;nbsp;have&amp;nbsp;two 32.768 kHz clock cycles after the TIMEOUT event where you can write debug information, but this is not enough time to write to flash. So writing whatever debuginformation you want to a RAM buffer and then writing to flash after reset is the most robust way (which we sometimes see used in big projects). Note that RAM content is not guaranteed after a WDT reset or a soft reset, but it is also not explicitly cleared, and in most cases it will be intact&amp;nbsp;(provided buffer is noinit), which is why you need a checksum.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Strings with Flashlog</title><link>https://devzone.nordicsemi.com/thread/496656?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2024 14:15:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:446ae462-7d20-40e3-93f0-4d4fa16828c2</guid><dc:creator>jspear</dc:creator><description>&lt;p&gt;Einar,&lt;/p&gt;
&lt;p&gt;Thanks for the reply and that makes sense that I wouldn&amp;#39;t want to use flashlog often. Like I mentioned, our ultimate goal is to use the crashlog functionality, so I was hoping to use flashlog to test out the similar functionality without having to force a crash to test the crashlog.&lt;/p&gt;
&lt;p&gt;That being said, while&amp;nbsp;it may not be a great idea to be putting logs into the flash memory often with flashlog, would it work&amp;nbsp;to send string data related to the error using the crashlog, or would I be running into the same issues? What would be the appropriate way to log crash information using the crashlog module?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Strings with Flashlog</title><link>https://devzone.nordicsemi.com/thread/496541?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2024 07:46:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f254ac9e-dd6a-4e6a-9f0d-e5bfad26eb46</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Joseph,&lt;/p&gt;
[quote user=""]How am I supposed to go about properly reading the stored flashlog data in real time?[/quote]
&lt;p&gt;You should probably not. If this is the goal, then I don&amp;#39;t see why you would want to use flash logging. There is CLI support in the flash backend and you can look at that for how to fetch logs from flash runtime (see &lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_nrf_log.html"&gt;Logger module documentation&lt;/a&gt;). I do not see much practical use of this in a real product, though. I shoudl add that I do not see the flash backend much used, which I believe there are a few reasons for.&lt;/p&gt;
&lt;p&gt;Logging to flash is mostly usefull for crash logs or very limited logging, as writing to flash takes time, and is also an asyncrhoneous operation that is scheduled by the SoftDevice. So if you are doing a lot of logging the flash backend is not a good option. Aso, it could be that in a bad state, it will not be possible to write to flash, so there are other more robust ways to do crash logging - one is to write debug information to a noinit RAM buffer (with a checksum), and check the content of that buffer at every boot to see if there is something, and then write it to flash (this is will not be using the logger module).&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>