<?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>How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101372/how-to-enable-debug-messages-for-zephyr-drivers</link><description>flash_erase() returns error code -19 (i.e. -ENODEV). But I can&amp;#39;t see any debug messages from source code of zephyr/drivers. How to enable debug messages for zephyr drivers? 
 int flashNorEraseData(const off_t offset, const size_t len) { if (!flashNorGetInitialzed</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 Jul 2023 11:08:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101372/how-to-enable-debug-messages-for-zephyr-drivers" /><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434435?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2023 11:08:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f127092-20f7-48aa-862b-569cb350d30d</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see that you are trying to add some logging to&amp;nbsp;z_impl_flash_erase() . This function will call this function&amp;nbsp;flash_nrf_erase() -&amp;gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.2.99-ncs1/drivers/flash/soc_flash_nrf.c#L198"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v3.2.99-ncs1/drivers/flash/soc_flash_nrf.c#L198&lt;/a&gt;&amp;nbsp; , so add your logging there instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434332?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2023 05:05:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:108ddb10-363f-4fb4-bb3a-c9e37c46a072</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6403.prj.conf"&gt;devzone.nordicsemi.com/.../6403.prj.conf&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434327?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2023 03:35:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8e7e45c-2b5a-4466-aac3-3b0ff29ff950</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8446.log_5F00_level_5F00_undeclared.zip"&gt;devzone.nordicsemi.com/.../8446.log_5F00_level_5F00_undeclared.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434326?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2023 03:34:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fa48111-433f-4ea8-9339-2d66e66af5d9</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6403.flash.h"&gt;devzone.nordicsemi.com/.../6403.flash.h&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434325?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2023 03:34:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbdab9b4-b7c0-44c9-aa29-e6bc9c62811b</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your reply! I have removed LOG_MODULE_REGISTER(flash) from D:\ncs\v2.3.0\zephyr\include\zephyr\drivers\flash.h. And I also addCONFIG_LOG_DEFAULT_LEVEL=4 to &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6403.prj.conf"&gt;6403.prj.conf&lt;/a&gt;. But west build still failed with error: &amp;#39;__log_level&amp;#39; undeclared. Please unzip &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8446.log_5F00_level_5F00_undeclared.zip"&gt;log_level_undeclared.zip&lt;/a&gt; for detail information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434174?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2023 11:01:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8ec96b7-fc48-444d-a7a5-d76aaf8048b4</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is already a log module registered for&amp;nbsp;soc_flash_nrf.c&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.2.99-ncs1/drivers/flash/soc_flash_nrf.c#L24"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v3.2.99-ncs1/drivers/flash/soc_flash_nrf.c#L24&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434125?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2023 09:07:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a62f72e-d626-45ac-93c1-de4b74f76bc2</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8546.custom_5F00_nrf52832.zip"&gt;devzone.nordicsemi.com/.../8546.custom_5F00_nrf52832.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434124?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2023 09:07:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30954c3b-eda6-4448-b974-fbe52d09ceca</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7607.minimal_5F00_log_5F00_flash.zip"&gt;devzone.nordicsemi.com/.../7607.minimal_5F00_log_5F00_flash.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434123?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2023 09:06:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65983b04-2d9e-4d02-86f5-b51c5d7c2bdd</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/redefinition.zip"&gt;devzone.nordicsemi.com/.../redefinition.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434122?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2023 09:05:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02f59e44-e81c-4711-8b68-194ac1d9c74c</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1273.flash.h"&gt;devzone.nordicsemi.com/.../1273.flash.h&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/434121?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2023 09:04:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49004ac5-248b-4506-b57d-e27fcc5956be</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;I have removed including printk.h in flash.h. But west build still failed with redefinition of &amp;#39;__log_current_const_data&amp;#39; error message. Please refer to redefinition.txt for detail information.&lt;/p&gt;
&lt;p&gt;Procedure to reproduce this issue.&lt;br /&gt;1. Unzip minimal_log_flash.zip to D:\ncs\v2.3.0\nrf\samples folder.&lt;br /&gt;2. Unzip custom_nrf52832.zip to D:\ncs\v2.3.0\nrf\boards\arm folder.&lt;br /&gt;3. Copying flash.h to D:\ncs\v2.3.0\zephyr\include\zephyr\drivers&lt;br /&gt;4. cd D:\ncs\v2.3.0\nrf\samples\minimal_log_flash&lt;br /&gt;5. west build -b custom_nrf52832&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/433933?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2023 12:10:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:893a929b-af35-4066-98fa-bd84181ab10c</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Try&amp;nbsp;CONFIG_LOG_DEFAULT_LEVEL=4&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/433897?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2023 09:55:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8eebe6b1-a250-4974-b4ea-abe84c0d6dc8</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;Main problems issue , I had replied for the other topic . You may check the root case with my experience.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/433890?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2023 09:35:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ab4184c-b461-476b-90f7-4e8c92ef1e3c</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Do you mean it should build okay if I remove including printk.h?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/433885?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2023 09:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:172278fc-98e2-4c36-904e-b0833f4d006f</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;For Matter development project , we use the NRF connect SDK 2.4.0 toolchain with VS Code IDE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The debug console message function is&amp;nbsp; LOG_INF()&lt;/p&gt;
&lt;p&gt;I know that the SES or Keil IDE. Project for&amp;nbsp; BLE or thread within Software device in Zephyr OS , The debug message function is printfk() as before.&lt;/p&gt;
&lt;p&gt;The redefinition means you can&amp;#39;t include the log.h and printk.h at the same time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/433876?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2023 09:00:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f71a110-5c72-43b6-9f59-cbe3d2b0f528</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your reply! I added the following code to D:\ncs\v2.3.0\zephyr\include\zephyr\drivers\flash.h.&lt;/p&gt;
&lt;p&gt;#include &amp;lt;zephyr/logging/log.h&amp;gt;&lt;br /&gt;#include &amp;lt;zephyr/sys/printk.h&amp;gt;&lt;/p&gt;
&lt;p&gt;LOG_MODULE_REGISTER(flash);&lt;/p&gt;
&lt;p&gt;static inline int z_impl_flash_erase(const struct device *dev, off_t offset,&lt;br /&gt; size_t size)&lt;br /&gt;{&lt;br /&gt; LOG_INF(&amp;quot;z_impl_flash_erase() e&amp;quot;);&lt;br /&gt; const struct flash_driver_api *api =&lt;br /&gt; (const struct flash_driver_api *)dev-&amp;gt;api;&lt;br /&gt; int rc;&lt;/p&gt;
&lt;p&gt;rc = api-&amp;gt;erase(dev, offset, size);&lt;/p&gt;
&lt;p&gt;return rc;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please refer to redefinition_of__log_level.txt for west build error messages.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debug messages for zephyr drivers?</title><link>https://devzone.nordicsemi.com/thread/433867?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2023 08:18:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e8e3f7e-ce70-43ae-ba90-7905365c7c62</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;Try LOG_INF() function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>