<?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>FileSystem Backend Log Overwrite takes a lot of CPU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113007/filesystem-backend-log-overwrite-takes-a-lot-of-cpu</link><description>Hi all, I am working on an nrf5340 and I activated the FileSystem Backend log to save the logs in my external Flash. It&amp;#39;s working how we are expecting to except once the flash is full. Once the system starts to overwrite data, we see a huge increase of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Jul 2024 13:39:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113007/filesystem-backend-log-overwrite-takes-a-lot-of-cpu" /><item><title>RE: FileSystem Backend Log Overwrite takes a lot of CPU</title><link>https://devzone.nordicsemi.com/thread/493927?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 13:39:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bdda510-a69b-421b-8fa3-e96129b455b5</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]Once the system starts to overwrite data, we see a huge increase of CPU usage.[/quote]
&lt;p&gt;Erasing flash is a time-consuming procedure, and the CPU has to pause during this operations. I am not fully sure how this works with erasing external flash, but it may be similar.&lt;br /&gt;Here is the file and place where the driver erases the flash:&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/c989b977d31eddf4b90eaf2f146740b6f4c8109a/drivers/flash/nrf_qspi_nor.c#L582"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/c989b977d31eddf4b90eaf2f146740b6f4c8109a/drivers/flash/nrf_qspi_nor.c#L582&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Can you add some logging to this function? Then you can see how often and how large areas are erased. That might give us some insight into this.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>