<?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>logging &amp;quot;deferred&amp;quot; crashes but &amp;quot;in place&amp;quot; works</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55909/logging-deferred-crashes-but-in-place-works</link><description>I&amp;#39;ve taken the basic examples/peripheral/blinky code and tried to add the logging module to it. For some reason the only time I can get the application to run and log correctly is when I use &amp;quot;in-place&amp;quot; logging. When trying to use &amp;#39;deferred&amp;#39; logging, the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 31 Dec 2019 07:32:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55909/logging-deferred-crashes-but-in-place-works" /><item><title>RE: logging "deferred" crashes but "in place" works</title><link>https://devzone.nordicsemi.com/thread/227132?ContentTypeID=1</link><pubDate>Tue, 31 Dec 2019 07:32:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23d332d1-2876-4a6b-a570-19c5639840cf</guid><dc:creator>webbcam</dc:creator><description>&lt;p&gt;That makes sense now. Thank you for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: logging "deferred" crashes but "in place" works</title><link>https://devzone.nordicsemi.com/thread/227037?ContentTypeID=1</link><pubDate>Mon, 30 Dec 2019 09:11:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9257027f-2d6e-484b-82ff-86513dc1b3a7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the additional info. So the problem is that the MBR needs this section of RAM to be able to forward interrupts to the Softdevice, application, and bootloader.&amp;nbsp; The interrupt forwarding doesn&amp;#39;t have to work with the original example as it does not have any interrupts sources&lt;span&gt;. But the&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span&gt;NRF_LOG_DEFERRED&amp;nbsp;config option makes the UART backend operate in asynchronous mode (i.e., interrupt mode)&amp;nbsp;and&amp;nbsp;thus making the app rely on receiving interrupts from the MBR. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: logging "deferred" crashes but "in place" works</title><link>https://devzone.nordicsemi.com/thread/226999?ContentTypeID=1</link><pubDate>Sat, 28 Dec 2019 21:19:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd490aa4-d223-4923-bb2f-52a65212747a</guid><dc:creator>webbcam</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your reply. I found a fix for this but &lt;strong&gt;I don&amp;#39;t really understand it&lt;/strong&gt;. &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/32762/call-to-vportstartfirsttask-fails-in-freertos-when-the-mbr-used-without-the-soft-device"&gt;I found a solution here for another problem I was debugging&lt;/a&gt;, by modifying the linker script blinky_gcc_nrf52.ld to change the RAM ORIGIN address from 0x20000000 to 0x20000010. Once doing this the deferred logging works as expected. My MEMORY section of linker script looks like this now:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;MEMORY
{
  FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xce000
  RAM (rwx) :  ORIGIN = 0x20000010, LENGTH = 0x3FFF0
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;For more context I am using this board: &lt;a href="https://www.adafruit.com/product/4062"&gt;https://www.adafruit.com/product/4062&lt;/a&gt; which specifies this &lt;a href="https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/hathach-memory-map"&gt;memory map&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not understanding where the MBR comes into play here and how making this change in the linker script fixed my problem. Could you please provide some insight in this?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;btw the exact example I&amp;#39;m using is the pca10056/armgcc blinky example from the 16.0 nRF52 SDK and added the logging module to enable logging over UART. I&amp;#39;m just using a text editor and the &amp;#39;arm-non-eabi-gcc&amp;#39; command line compiler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: logging "deferred" crashes but "in place" works</title><link>https://devzone.nordicsemi.com/thread/226895?ContentTypeID=1</link><pubDate>Fri, 27 Dec 2019 09:12:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8de51f18-1a7b-41ed-9b6b-1585154f90bc</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see anything in the code you wrote. The main thing when using deferred logging is to&amp;nbsp;remember to call&amp;nbsp;&lt;span&gt;NRF_LOG_PROCESS() or&amp;nbsp;NRF_LOG_FLUSH() to process the log buffers which you have already done.&amp;nbsp;Are you using Segger embedded studio? In that case, do you use the default flash_placement.xml configuration and is the INITIALIZE_USER_SECTIONS flag still defined in your project settings.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Blinky example from SDK 16 with logging over RTT:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-eaf67782a6e8423a872977aba769132b/blinky_5F00_logging.zip"&gt;devzone.nordicsemi.com/.../blinky_5F00_logging.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>