<?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>Bootloader - serial output of logging info</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67759/bootloader---serial-output-of-logging-info</link><description>Hello, 
 I want to create/compile a (Nordic) secure bootloader with serial output. 
 I know the example of the dfu secure_bootloader. I also know there is a nomal and a debug variant. 
 I have two problems: 
 
 1) What defines do I need to set to debug</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Nov 2020 13:33:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67759/bootloader---serial-output-of-logging-info" /><item><title>RE: Bootloader - serial output of logging info</title><link>https://devzone.nordicsemi.com/thread/278089?ContentTypeID=1</link><pubDate>Mon, 02 Nov 2020 13:33:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f56ff1bf-d878-427b-aac8-b6c452e82fd6</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Marie,&lt;/p&gt;
&lt;p&gt;Sorry for the mistake. It is&amp;nbsp;&lt;span&gt;NRF_LOG_BACKEND_UART_ENABLED that should be enabled for log UART backend in the sdk_config.h. I have corrected the previous reply.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;1) If you update via USB, please refer to the sdk_config.h under&amp;nbsp;nRF5_SDK\examples\dfu\secure_bootloader\pca10040_usb_debug\config and enable&amp;nbsp;&lt;span&gt;NRF_LOG_BACKEND_UART_ENABLED. You could see the log with the terminal tool.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you use&amp;nbsp;pca10040_uart_debug, do not logging over UART. Instead, you should use RTT logging. The example bootloader projects come in pairs, one with debug logging over RTT and one without. Since you have used &amp;lt;SDK&amp;gt;\examples\dfu\secure_bootloader\pca10040_uart, I would like you to try&amp;nbsp;&amp;lt;SDK&amp;gt;\examples\dfu\secure_bootloader\pca10040_uart_debug instead, and observe the logs using Segger RTT Viewer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2)&amp;nbsp;&lt;/span&gt;The bootloader start address is stored in one of the UICR register, which is written when you flash the bootloader to the nRF52832, see&amp;nbsp;nrf_bootloader_info.c in the bootloader example. The MBR will check this UICR register on boot and then jump to the bootloader if there is an address present. On jumping to the application, the bootloader will jump to the SoftDevice, and then the SoftDevice will jump to its end address where it expects the application to be located. Also, see this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33085/nrf52832-booting-sequence/128510#128510"&gt;post&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If your application runs without the softdevice, you should set the flash start address to 0x1000 &amp;nbsp;(end of MBR) &lt;span&gt;and set RAM_START to&amp;nbsp;0x20000008 for the&amp;nbsp;MBR application&lt;/span&gt;. See this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/57989/nrf52832-serial-bootloader-without-sd-fails-to-boot-app/235579#235579"&gt;post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With SoftDevice, the flash start address should be&amp;nbsp;0x0002 6000 (end of SoftDevice) for s132.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader - serial output of logging info</title><link>https://devzone.nordicsemi.com/thread/277624?ContentTypeID=1</link><pubDate>Thu, 29 Oct 2020 14:09:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2661275e-0084-4874-a6d7-53ebafb36e5e</guid><dc:creator>MarieMaurer</dc:creator><description>&lt;p&gt;Thanks for your answer!&lt;/p&gt;
&lt;p&gt;1) I already have this define set to 1. But then I get &lt;/p&gt;
&lt;p&gt;undefined reference to `nrf_log_default_backends_init&amp;#39;&lt;/p&gt;
&lt;p&gt;More defines needed? Or modules I must add?&lt;/p&gt;
&lt;p&gt;What about e.g. NRF_LOG_BACKEND_UART_ENABLED? But just tried, it makes at least no difference for this error.&lt;/p&gt;
&lt;p&gt;What is difference between define prefixed with NRF_ and the ones without it? One for internal, one for user?&lt;/p&gt;
&lt;p&gt;2) One is&lt;/p&gt;
&lt;p&gt;FLASH (rx) : ORIGIN = 0x71000, LENGTH = 0xd000&lt;/p&gt;
&lt;p&gt;the other is&lt;/p&gt;
&lt;p&gt;FLASH (rx) : ORIGIN = 0x78000, LENGTH = 0x6000&lt;/p&gt;
&lt;p&gt;This section is in flash. When it is once at this address, once at other address, how does caller know, where to call the bootloader? I assume MBR is started first via vector table, SP and IP. And then? What and how does MBR know how to continue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader - serial output of logging info</title><link>https://devzone.nordicsemi.com/thread/277613?ContentTypeID=1</link><pubDate>Thu, 29 Oct 2020 13:38:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddf20a96-b2f2-4f4d-b8e2-571be0f935b7</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Marie,&lt;/p&gt;
[quote user=""]1) What defines do I need to set to debug out of serial port?[/quote]
&lt;p&gt;You can enable NRF_LOG_BACKEND_UART_ENABLED In the sdk_config.h of the example as&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;e&amp;gt; NRF_LOG_BACKEND_UART_ENABLED - nrf_log_backend_uart - Log UART backend
//==========================================================
#ifndef NRF_LOG_BACKEND_UART_ENABLED
#define NRF_LOG_BACKEND_UART_ENABLED 1
#endif&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then, you should be able to see the debug log in the serial terminal. See the&amp;nbsp;&lt;a title="Logger module" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__log.html?cp=7_5_2_6_11_29"&gt;Logger module&lt;/a&gt;&amp;nbsp;documentation.&lt;/p&gt;
[quote user=""]Can you give me a few hints about side effects of this change?[/quote]
&lt;p&gt;&amp;nbsp;As long as you have enough space for the application and bootloader, I think that should be fine. In the secure_bootloader for uart example, you might find the&amp;nbsp;&lt;span&gt;bootloader address is different from the&lt;/span&gt;&amp;nbsp;&lt;a title="Memory layout" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_bootloader.html?cp=7_1_3_5_0_7#lib_bootloader_memory"&gt;Memory layout&lt;/a&gt;&amp;nbsp;documentation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>