<?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>Using printk on custom board nRF Connect SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96950/using-printk-on-custom-board-nrf-connect-sdk</link><description>Hello. I have a custom board featuring nRF5340. I have a programming interface that i connect to the DK in order to program it, using SWDIO, SWDCLK and RESET. In addition, I have a micro USB port set exactly like the on in the DK. 
 Given that, how do</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Feb 2023 14:27:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96950/using-printk-on-custom-board-nrf-connect-sdk" /><item><title>RE: Using printk on custom board nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/411695?ContentTypeID=1</link><pubDate>Thu, 23 Feb 2023 14:27:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:054bb8fa-9b01-4788-b90f-69304630bde4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Dario,&lt;/p&gt;
&lt;p&gt;Could you elaborate what you meant by &amp;quot;print via the dev-kit that&amp;nbsp;I connect to&amp;quot; . How do you connect your board to the devkit ? Via GPIO or via SWD interface ?&amp;nbsp;&lt;br /&gt;You can use the DK UART by connecting the UART pins of the custom board to the UART pin of the nRF5340 on the DK. If you don&amp;#39;t flash anything on the nRF5340 DK you can overwrite the nRF5340 on the DK and transmit your UART data via the interface chip on the DK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you simply want printk to be routed to RTT. You can try the example I attached here. It works on the DK configuration, so I&amp;#39;m don&amp;#39;t know if it work with your board dts configuration or not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/button_5F00_RTT.zip"&gt;devzone.nordicsemi.com/.../button_5F00_RTT.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you want to output to the onboard USB interface, you may want to look at the thingy53&amp;nbsp;samples that it output the log via USB. Check the peripheral_uart sample. It has both RTT and USB (UART) log.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using printk on custom board nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/411689?ContentTypeID=1</link><pubDate>Thu, 23 Feb 2023 14:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5981ba5-8f59-47c7-b19f-2c2cdadbd4f4</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;I solved by using the following config&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_UART_CONSOLE&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_CONSOLE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_USE_SEGGER_RTT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_RTT_CONSOLE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;And it works just fine with the printk function&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using printk on custom board nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/411439?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 15:13:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e98ba454-4a65-440f-829f-e3090fe1b149</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;The build is failing and it fails until i comment out the CONFIG_LOG =y line&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map &lt;br /&gt;cmd.exe /C &amp;quot;cd . &amp;amp;&amp;amp; C:\ncs\toolchains\v2.2.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf -Wl,-T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=C:/Users/dsortino/Desktop/GitHubProj/component_ifeel/element_firmware/iFeel_ConnectSDK/iFeel-WiredReceiver/build/zephyr/zephyr_pre0.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a zephyr/lib/libc/minimal/liblib__libc__minimal.a zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a zephyr/subsys/fs/libsubsys__fs.a zephyr/drivers/usb/device/libdrivers__usb__device.a zephyr/drivers/clock_control/libdrivers__clock_control.a zephyr/drivers/console/libdrivers__console.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/i2c/libdrivers__i2c.a zephyr/drivers/spi/libdrivers__spi.a zephyr/drivers/hwinfo/libdrivers__hwinfo.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/timer/libdrivers__timer.a modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a modules/fatfs/lib..__modules__fs__fatfs.a modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a modules/segger/libmodules__segger.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj -L&amp;quot;c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/thumb/v8-m.main/nofp&amp;quot; -LC:/Users/dsortino/Desktop/GitHubProj/component_ifeel/element_firmware/iFeel_ConnectSDK/iFeel-WiredReceiver/build/zephyr -lgcc zephyr/arch/common/libisr_tables.a -no-pie -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -Wl,-X -Wl,-N -Wl,--orphan-handling=warn C:/ncs/v2.2.0/nrfxlib/crypto/nrf_cc312_platform/lib/cortex-m33/soft-float/no-interrupts/libnrf_cc312_platform_0.9.16.a &amp;amp;&amp;amp; cmd.exe /C &amp;quot;cd /D C:\Users\dsortino\Desktop\GitHubProj\component_ifeel\element_firmware\iFeel_ConnectSDK\iFeel-WiredReceiver\build\zephyr &amp;amp;&amp;amp; C:\ncs\toolchains\v2.2.0\opt\bin\cmake.exe -E echo &amp;quot;&amp;quot;&lt;br /&gt;c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: zephyr/libzephyr.a(sync_rtc.c.obj): in function `sync_rtc_setup&amp;#39;:&lt;br /&gt;C:\ncs\v2.2.0\zephyr\soc\arm\nordic_nrf\nrf53\sync_rtc.c:240: undefined reference to `__device_dts_ord_21&amp;#39;&lt;br /&gt;collect2.exe: error: ld returned 1 exit status&lt;br /&gt;ninja: build stopped: subcommand failed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using printk on custom board nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/411437?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 15:11:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85294b60-ca0e-4763-8a1f-7d91f934af2a</guid><dc:creator>MaximSh</dc:creator><description>&lt;p&gt;What failed?&lt;br /&gt;Did you opened a J-Link RTT Viewer?&amp;nbsp;&lt;br /&gt;It should work with this configs&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using printk on custom board nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/411436?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 15:06:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:697506d2-82e3-426f-837b-62c63d162c87</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;Still doesnt work. Maybe its a matter of dts&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using printk on custom board nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/411430?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 15:01:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a3dbf44-2664-405c-82eb-beb43fb8d983</guid><dc:creator>MaximSh</dc:creator><description>&lt;div&gt;
&lt;div&gt;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;logging/log.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using printk on custom board nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/411428?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 15:00:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96fd8ef1-df58-4f79-9eda-4e045c4ca4ae</guid><dc:creator>dario.sortino</dc:creator><description>&lt;div id="MathJax_Message" style="display:none;"&gt;&lt;/div&gt;
&lt;p&gt;I fail to build with this setup.&lt;/p&gt;
&lt;p&gt;Any include to add?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using printk on custom board nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/411423?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 14:51:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4080de3a-f0fc-417d-8188-9181a400f798</guid><dc:creator>MaximSh</dc:creator><description>&lt;p&gt;If you want to print via&amp;nbsp;&lt;span&gt;SWDIO you can use RTT&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Configs&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_LOG&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_UART_CONSOLE&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_CONSOLE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_USE_SEGGER_RTT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_RTT_CONSOLE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;Code&lt;/strong&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;1. Define&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;LOG_LEVEL&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;LOG_LEVEL_INF&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;MODULE&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BLE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;LOG_MODULE_REGISTER&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;MODULE&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;2. Use&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;LOG_DBG&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;Test&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;%d&lt;/span&gt;&lt;span&gt;\n&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;data&lt;/span&gt;&lt;span&gt;);&lt;br /&gt;LOG_INF(...)&lt;br /&gt;LOG_WRN(...)&lt;br /&gt;LOG_ERR(...)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>