<?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>Debugging two custom images in one debug session</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85135/debugging-two-custom-images-in-one-debug-session</link><description>I have two custom images that I flash to my chip (nRF52832, SDK v16.0.0, SEGGER Embedded Studio). Application 1 is located at 0x26000 Application 2 is located at 0x45000. Application 1 always runs at start up and depending on certain conditions, it will</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Mar 2022 07:59:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85135/debugging-two-custom-images-in-one-debug-session" /><item><title>RE: Debugging two custom images in one debug session</title><link>https://devzone.nordicsemi.com/thread/357543?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 07:59:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:053f334c-7b9f-49ef-971a-9733c0ca171b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I think what you are seeing is the SES feature. There are settings in the SES where you can set the Debugger to steal the RTT logs and display them to the SES debug terminal instead of any other terminal. I do no think this is related to your solution but the way the SES and RTT viewer are trying to get a lock on the prints.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1646985411265v1.png" alt=" " /&gt;&lt;/p&gt;
[quote user="kcl74"]If I find some time I&amp;#39;ll recreate the projects so you can replicate it on your end.[/quote]
&lt;p&gt;Yes please do that, it will be helpful for me to understand more on this issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging two custom images in one debug session</title><link>https://devzone.nordicsemi.com/thread/356970?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 17:13:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e768f073-8e74-4646-a9b2-f3c48f2999ab</guid><dc:creator>kcl74</dc:creator><description>&lt;p&gt;This is a custom board that has nothing connected to it other than a JLink Base unit.&amp;nbsp; Whatever is getting printed to a terminal is&amp;nbsp;through the means of the SWIO pin connected to the JLink unit.&lt;/p&gt;
&lt;p&gt;To be clear, the linked library has 0 dependency on nRF5 SDK/SoftDevice.&amp;nbsp; It is a native C library that is compiled in SES (using gcc).&amp;nbsp; It&amp;#39;s just calling &amp;quot;printf&amp;quot;, it is not calling any sort of NRF_LOG or anything of the sort because it has no idea nRF platform exists.&lt;/p&gt;
&lt;p&gt;The linked library is also not hitting a hardfault because the second I connect my JLink unit when the application is hanging, the chip spits out whatever data is in the buffer used for printf, presumably because the JLink CLK pin clocks that data out, and then the application continues to run from where it left off--it doesn&amp;#39;t reset, it isn&amp;#39;t stuck in hardfault handler, it resumes.&lt;/p&gt;
&lt;p&gt;If I find some time I&amp;#39;ll recreate the projects so you can replicate it on your end.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging two custom images in one debug session</title><link>https://devzone.nordicsemi.com/thread/356028?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 12:25:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae13cb9c-d9e9-4711-8033-69562e4c1e4b</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="kcl74"]but the printf calls from the linked library end up only in the Debug Terminal in SES. [/quote]
&lt;p&gt;It looks like the prints from the precompiled library are redirected to serial port and the application is configured to redirect the logs to the RTT.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It looks like there is a bug in the way logs are handled in the linked library. It most likely is causing a stack overflow (if you are using buffers) and eventually an hardfault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging two custom images in one debug session</title><link>https://devzone.nordicsemi.com/thread/355666?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 23:09:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bee898a-52c3-42fa-8fc7-26004355b5a0</guid><dc:creator>kcl74</dc:creator><description>&lt;p&gt;So I have a pre compiled library that I&amp;#39;m using which calls printf. It is intended to be a portable C library. I build the library with SES.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My application that links against the library is my nRF52832 nRF5 SDK project. It does not utilize nRF logging module. It does use FreeRTOS. The printing task also calls printf and nothing else.&lt;/p&gt;
&lt;p&gt;When I run the project in SES I can see the output from the printf statements in the Debug Terminal.&lt;/p&gt;
&lt;p&gt;It gets more interesting...&lt;/p&gt;
&lt;p&gt;When I start debugging and hit breakpoint at main(), if I open J-Link RTT Viewer and connect, then continue running my code in SES, the printfs that are called from the task is output to RTT Viewer, but the printf calls from the linked library end up only in the Debug Terminal in SES. No printf out from the task is shown in SES Debug Terminal and no printf output from the linked library is shown in the RTT Viewer.&lt;/p&gt;
&lt;p&gt;The only thing connected between my PC and my board is Vref, Gnd, IO, CLK running into my J-Link Base unit.&lt;/p&gt;
&lt;p&gt;Today I found that the printf in my linked library caused my nRF application to hang when I didn&amp;#39;t have a debugger attached. When I attached the debugger via SES, the first thing I saw was the output from the printf in the linked library, and then the application ran without issues. I&amp;#39;m not sure why that happens.&amp;nbsp; I removed the printf statements from the linked library and the application stopped hanging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging two custom images in one debug session</title><link>https://devzone.nordicsemi.com/thread/355301?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 14:01:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c573fcac-dcf7-413c-b1b7-c67a122edac9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;If both the applications are using the same UART instance then probably the second application re-initialization of UART registers might be causing some conflicts. Try to use two different UART instances for two application logging. Also check your preprocessor defines to see if there is any way that might cause the logs to be not included into the build. I do not see any other reason for the two applications to have the logs work correctly if they are using different RAM spaces.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging two custom images in one debug session</title><link>https://devzone.nordicsemi.com/thread/355281?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 13:11:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c583f47e-2881-4ac6-9c6f-053d262d4c71</guid><dc:creator>kcl74</dc:creator><description>&lt;p&gt;Then it&amp;#39;s UART because the applications are only using printf. No logging module or anything fancy.&lt;/p&gt;
&lt;p&gt;I am still hitting breakpoints in both applications.&amp;nbsp; I&amp;#39;m specifying to use the .elf files of the additional application when I load additional information.&lt;/p&gt;
&lt;p&gt;I can also jump between the two applications and see the different BLE service UUIDs advertise. If i find time I&amp;#39;ll try to create project that reproduces the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging two custom images in one debug session</title><link>https://devzone.nordicsemi.com/thread/355210?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 10:07:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b9ba426-f50e-4de1-b02a-904c0f916387</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Kevin,&lt;/p&gt;
&lt;p&gt;Which print statements are you using? The normal printf in our SDK redirect the logs to the UART and not RTT.&lt;/p&gt;
[quote user=""]What do I have to do differently so I can see the printf output from both applications?&amp;nbsp;&amp;nbsp;[/quote]
&lt;p&gt;I do not have any information on both of your application contents to say why your second application is not showing your logs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you give more information on what kind of logs have you enabled? and how do you check if your second application is starting at all?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>