<?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>Dynamically switching Logs</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59934/dynamically-switching-logs</link><description>Hi, 
 
 I am using nrf52840 Preview - DK, with SDK v15.3.0 and Softdevice API 6.1.1 
 As we need to set NRF_LOG by setting the NRF_LOG_ENABLE and NRF_LOG_BACKEND_URAT_ENABLE and NRF_FPRINTF to 0 in the sdk_config file to conserver power, which is a compile</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Apr 2020 13:34:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59934/dynamically-switching-logs" /><item><title>RE: Dynamically switching Logs</title><link>https://devzone.nordicsemi.com/thread/244463?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2020 13:34:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2685e67c-6fac-4164-9bec-b63a306e8fd6</guid><dc:creator>Aamir</dc:creator><description>&lt;p&gt;actually I have quite an extensive code already, and I am already using NRF_LOG. If this helps in my power consumption, it&amp;#39;s going to be a lot less work. I will have to definitely have to use UART if it doesn&amp;#39;t work.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically switching Logs</title><link>https://devzone.nordicsemi.com/thread/244428?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2020 12:34:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c8c2531-1a0c-4a33-bbf1-4eeefc24dd0e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;My expectation is that they will draw a similar amount of power, as the NRF_LOG use the UART peripheral, but it is not possible to deinit the NRF_LOG module. Another disadvantage with using the NRF_LOG is that it is a quite large code base, so it will take up quite a bit of flash. I don&amp;#39;t know if your project is already using up a lot of flash, but it just sounds more tidy to use the UART, which you will be able to turn off again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically switching Logs</title><link>https://devzone.nordicsemi.com/thread/244393?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2020 10:27:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5442e2ab-a9d6-4ebe-a525-da8bd376c1fe</guid><dc:creator>Aamir</dc:creator><description>&lt;p&gt;Thanks for your reply, yup we are indeed stuck. Let&amp;#39;s see I&amp;#39;ll write logic for both and check which consumes less power. I&amp;#39;ll let you know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically switching Logs</title><link>https://devzone.nordicsemi.com/thread/244372?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2020 09:33:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:889c6015-dacb-44e7-9758-b78a60b3bd38</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I don&amp;#39;t have access to the tools myself. I suspect we&amp;#39;re in the same home office situation.&lt;/p&gt;
&lt;p&gt;If you insist on using the NRF_LOG_MODULE, then I suggest that you have another layer with a variable deciding whether to print or not.&lt;/p&gt;
&lt;p&gt;If this variable is true, then you call log_init() and call NRF_LOG_INFO();&lt;/p&gt;
&lt;p&gt;But I believe it would be easier for you use the UART directly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically switching Logs</title><link>https://devzone.nordicsemi.com/thread/244157?ContentTypeID=1</link><pubDate>Thu, 09 Apr 2020 07:52:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bb8aad0-4acf-45b7-8b8f-4f57a7b3d815</guid><dc:creator>Aamir</dc:creator><description>&lt;p&gt;I am not sure if call to log_init function makes a difference in power consumption. I mean we have to set NRF_FPRINTF and NRF_BACKEND_UART_ENABLE to 0 for reducing power consumption. I can change the operation of the device to require reset whenever the switch is toggled, but only if the call to log_init function makes a difference in power consumption. can you verify it ? I can&amp;#39;t right now, I don&amp;#39;t have access to any measurement tools.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically switching Logs</title><link>https://devzone.nordicsemi.com/thread/244030?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2020 09:31:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdd21ff8-2a9b-4a61-a269-c2e73be8cb85</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I assume that resetting the device whenever you turn the switch off is not a viable solution for you? Because then you can initialize the log based on that. If not, you will have to do this based on UART, and initialize it when you flick the switch on, uninitialize it when you switch it off, and have some function call that will print the log message if the UART is on, and discard the message if it is off.&lt;/p&gt;
&lt;p&gt;That is at least what I can come up with. The NRF_LOG module is not dynamic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically switching Logs</title><link>https://devzone.nordicsemi.com/thread/244015?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2020 08:54:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12911437-1ed7-4e8e-b065-175f67d07d08</guid><dc:creator>Aamir</dc:creator><description>&lt;p&gt;Yes, that is definitely a way. but, I am facing a slightly different problem here. In my system there would be a physical switch which when turned ON will enable critical information to be printed and if it is OFF then nothing should be printed which would be the maximum power saving mode.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically switching Logs</title><link>https://devzone.nordicsemi.com/thread/243905?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2020 12:55:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f04fc4b6-7374-4972-b661-ebdcb102cb3c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It is not possible to turn off the logging module in the SDK. If you turn it on, it stays on. If you want to log only certain parts and turn it off, I suggest that you look into using the UART directly, without the logging module. That way, you can uninitialize it when you are done.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>