<?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>Build Environment Problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88123/build-environment-problem</link><description>I&amp;#39;ve just installed the Nordic SDK version 17.1, SES version 6.3, and Segger J-Link Software version 7.64e on a new Ubuntu 22.04 laptop. 
 I&amp;#39;ve installed everything in their default locations. I&amp;#39;m using a pca10056 nrf52840 DK. 
 I am able to open SES</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Jun 2022 19:26:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88123/build-environment-problem" /><item><title>RE: Build Environment Problem</title><link>https://devzone.nordicsemi.com/thread/370768?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 19:26:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8950b519-7981-4872-b87d-a4c9110d0f1f</guid><dc:creator>Shahar</dc:creator><description>&lt;p&gt;My fixes for v6.20+ are focused on the RTT and the RTT redirect (which breaks &lt;strong&gt;all&lt;/strong&gt; project from nRF5 SDK).&lt;/p&gt;
&lt;p&gt;So adding those two lines in the&amp;nbsp;&lt;strong&gt;SEGGER_RTT_Syscalls_SES.c&amp;nbsp;&lt;/strong&gt;is the cleanest solution.&lt;/p&gt;
&lt;p&gt;As I&amp;#39;ve seen some discussions here struggeling with&amp;nbsp;&lt;strong&gt;__SEGGER_RTL_VERSION&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build Environment Problem</title><link>https://devzone.nordicsemi.com/thread/370766?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 19:16:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72e365a6-7c9b-4572-ab63-8335ffa501c7</guid><dc:creator>matty</dc:creator><description>&lt;p&gt;Thank you Shahar. For what its worth, using the libUARTE_async library seems to work for me. But my application doesn&amp;#39;t use the SoftDevice.&amp;nbsp;Also at this point I haven&amp;#39;t tried a release build or optimization. I also want to try that UART library again using your suggestions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build Environment Problem</title><link>https://devzone.nordicsemi.com/thread/370762?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 18:50:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85af7f7b-5ae3-4bff-98f8-c8a8932fe33e</guid><dc:creator>Shahar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;6.30 has a combination of multiple issues (building in release mode, etc - see this: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/87736/segger-embedded-studio-latest-incompatible-with-nrf5-sdk)"&gt;devzone.nordicsemi.com/.../segger-embedded-studio-latest-incompatible-with-nrf5-sdk)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I would suggest sticking to 6.22a for now with the following fix/workaround (as in 6.20 RTT was modified)&lt;/p&gt;
&lt;p&gt;in &lt;strong&gt;SEGGER_RTT_Syscalls_SES.c&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;modify to look like this (and remember to add #endif at line 264)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;sdk_config.h&amp;quot;
#if !defined(RETARGET_ENABLED) || RETARGET_ENABLED == 0
#if (defined __SES_ARM) || (defined __CROSSWORKS_ARM)

#include &amp;quot;SEGGER_RTT.h&amp;quot;
#if !defined(__SEGGER_RTL_VERSION)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If using UART modfiy&amp;nbsp;&lt;strong&gt;retarget.c &lt;/strong&gt;at&amp;nbsp;line 99 as so:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#if defined(__SES_VERSION) &amp;amp;&amp;amp; (__SES_VERSION &amp;gt;= 34000) &amp;amp;&amp;amp; !defined(__SEGGER_RTL_VERSION)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build Environment Problem</title><link>https://devzone.nordicsemi.com/thread/369356?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 15:56:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:576e243f-dc54-4153-91f7-9b2a63fd75d2</guid><dc:creator>matty</dc:creator><description>&lt;p&gt;Thank you, Vidar. I want to implement something using UARTE before closing this. Even though the libuarte example worked, I want to confirm it. Might take a day or two.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build Environment Problem</title><link>https://devzone.nordicsemi.com/thread/369319?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 14:12:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07c74618-a8a0-4432-98a1-bc8764a0dac5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;No worries, thanks for confirming what the issue was!&lt;/p&gt;
[quote userid="87216" url="~/f/nordic-q-a/88123/build-environment-problem/369288#369288"]I would like to understand why I can&amp;#39;t use SES 6.30 and the nordic_sdk_17.1 and the UART Library&amp;nbsp;since it looks like you can&amp;#39;t.[/quote]
&lt;p&gt;You should be able to work with any of the uart libaries or drivers. The limitation is that you will not be able use the app uart library as the standard output for printf() because our retarget.c file is not compatible with the new Segger runtime libraries. You can see the changes that would have been required from the Segger Wiki page I linked to in my initial reply (Under &amp;quot;User-supplied I/O&amp;quot;).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build Environment Problem</title><link>https://devzone.nordicsemi.com/thread/369288?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 12:58:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aac199b4-8d89-4335-bc84-a4c2691b79ba</guid><dc:creator>matty</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/88123/build-environment-problem/369248#369248"]The Debug Terminal window will only display RTT traffic indicating that the printf()&amp;#39;s are being redirected to RTT instead of UART in your case, but I don&amp;#39;t see how this could have happened with these default project settings:[/quote]
&lt;p&gt;My apologies. I hadn&amp;#39;t checked my sdk_config.h file. I know I said it wasn&amp;#39;t modified but I must have done so during my&amp;nbsp;trials and forgotten. Setting RETARGET_ENABLE to 1 gets that to work as it should.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/88123/build-environment-problem/369248#369248"]Are you relying on retarget.c/prinft()s to send the UART data?[/quote]
&lt;p&gt;If my interpretation is correct, that won&amp;#39;t compile when using SES version 6.30.&lt;/p&gt;
&lt;p&gt;For example, using SES 6.30 and the nordic_sdk_17.1/examples/peripheral/uart example:&lt;/p&gt;
&lt;p&gt;retarget.c&amp;nbsp;either has to be removed from the project or RETARGET_ENABLE has to either be set to 0 or removed from the sdk_config.h file. But that is step one of two. The second step requires you to change the project&amp;#39;s common options &amp;gt; Library &amp;gt; Library I/O to RTT from NONE. These two steps allow you to compile and load the DK. But printf() is redirected as you would expect, (I guess), since your I/O library seemingly uses RTTViewer exclusively.&lt;/p&gt;
&lt;p&gt;I would like to understand why I can&amp;#39;t use SES 6.30 and the nordic_sdk_17.1 and the UART Library&amp;nbsp;since it looks like you can&amp;#39;t. But it does look like the UARTE will work, (at least based on the nordic_sdk_17.1/examples/peripheral/libuarte example).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build Environment Problem</title><link>https://devzone.nordicsemi.com/thread/369248?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 11:16:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4246851a-0877-45de-927f-195369ae2388</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="matty"] run in the SES debugger and all the uart strings appear in the debugger&amp;#39;s output window. Also I am able to enter keyboard characters through the terminal and watch the code reject everything but &amp;#39;q&amp;#39;.[/quote]
&lt;p&gt;The Debug Terminal window will only display RTT traffic indicating that the printf()&amp;#39;s are being redirected to RTT instead of UART in your case, but I don&amp;#39;t see how this could have happened with these default project settings:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1653387637280v2.png" alt=" " /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1653387690778v3.png" alt=" " /&gt;&lt;/p&gt;
[quote user="matty"] I tried the nordic_sdk_17.1 libuarte example with SES 6.30. All I did was remove the SEGGER_RTT_Syscalls_SES.c file from the project. It worked exactly as described.[/quote]
&lt;p&gt;Yes, this should be sufficient for the other projects that include&amp;nbsp;SEGGER_RTT_Syscalls_SES.c but don&amp;#39;t rely on retarget.c.&lt;/p&gt;
[quote user="matty"]Ultimately I have to use SES 6.30 and the nordic_sdk_17.1 and make use of NRF_LOG_&amp;nbsp; macros to the Segger RTTViewer and use UART to get information into the firmware and out of the firmware. In fact I have the beginnings of a project that uses all four and its just the UART portion that isn&amp;#39;t working although everything compiles and links. I can even use NRF_LOG_INFO, NRF_LOG_ERROR to see that the APP_UART_ macros are returning without error[/quote]
&lt;p&gt;Are you relying on retarget.c/prinft()s to send the UART data?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build Environment Problem</title><link>https://devzone.nordicsemi.com/thread/369136?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 02:26:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a16d1a5-b4e1-4165-b046-ddf968b174f3</guid><dc:creator>matty</dc:creator><description>&lt;p&gt;Update - I tried the nordic_sdk_17.1 libuarte example with SES 6.30. All I did was remove the SEGGER_RTT_Syscalls_SES.c file from the project. It worked exactly as described.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build Environment Problem</title><link>https://devzone.nordicsemi.com/thread/369122?ContentTypeID=1</link><pubDate>Mon, 23 May 2022 21:21:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:612dff46-af58-40c3-bfcc-39e7a49be951</guid><dc:creator>matty</dc:creator><description>&lt;p&gt;I am not getting anywhere with this.&lt;/p&gt;
&lt;p&gt;1) I use SES 5.42b and open the nordic_sdk_16/examples/peripheral/uart example, compile and load the DK. I see all the expected results in my GTKTerm window.&lt;/p&gt;
&lt;p&gt;2) I use SES 5.42b and open nordic_sdk_17.1/examples/peripheral/uart example, compile and load the DK. I don&amp;#39;t see anything in my GTKTerm window. I run in the SES debugger and all the uart strings appear in the debugger&amp;#39;s output window. Also I am able to enter keyboard characters through the terminal and watch the code reject everything but &amp;#39;q&amp;#39;. So UART is working half-way. As in this post:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/87492/uart-example-in-nrf5-sdk-v17-0-2-not-working-as-expected-when-built-using-segger-embedded-studio-for-arm-v6-22"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/87492/uart-example-in-nrf5-sdk-v17-0-2-not-working-as-expected-when-built-using-segger-embedded-studio-for-arm-v6-22&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3) I use SES 6.30 and open a copy of the nordic_sdk_17.1 uart example. I use project options to change the Library I/O to RTT and I remove the retarget.c file from the project. As suggested in the post you provided in the edit. The project compiles and I load the DK. the results are exactly like 2).&lt;/p&gt;
&lt;p&gt;I&amp;#39;m going to try the nordic_sdk_17.1 libuarte example next. In the meantime can you provide any insight. I would have expected number 2 to work. There must be something about my environment that effects the 17.1 SDK.&lt;/p&gt;
&lt;p&gt;Ultimately I have to use SES 6.30 and the nordic_sdk_17.1 and make use of NRF_LOG_&amp;nbsp; macros to the Segger RTTViewer and use UART to get information into the firmware and out of the firmware. In fact I have the beginnings of a project that uses all four and its just the UART portion that isn&amp;#39;t working although everything compiles and links. I can even use NRF_LOG_INFO, NRF_LOG_ERROR to see that the APP_UART_ macros are returning without errors. Because of the lack of UART issue, I went back to basics and tried using the uart example and I&amp;#39;m finding all of these difficulties.&lt;/p&gt;
&lt;p&gt;My development set-up is as described at the top of this post. The sdk_config.h file and main.c are as provided by the examples and are unchanged. Any help will be greatly appreciated, thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build Environment Problem</title><link>https://devzone.nordicsemi.com/thread/368739?ContentTypeID=1</link><pubDate>Fri, 20 May 2022 08:18:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:803b010b-e5d2-4f3d-bec1-e381af70b11f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The problem is that our retarget.c implementation responsible for redirecting printf() to print data out on UART is not compatible with the Segger Runtime library used in version 6.x.x of Segger embedded studio (&lt;a href="https://wiki.segger.com/Embedded_Studio_Library_IO"&gt;Embedded Studio Library IO&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The recommended solution is to downgrade Embedded studio to the version we used for the release testing which was 5.42a. Excerpt from SDK release notes:&lt;/p&gt;
&lt;pre&gt;nRF5 SDK v17.1.0
------------------------
Release Date: August, 2021
 
Highlights:
 
- Added support for the new versions of the nRF52 devices:
   - nRF52820 revision 3
   - nRF52832 revision 3
   - nRF52833 revision 2
   - nRF52840 revision 3
   (Note: Programming these requires nrfjprog v10.13 or newer.)
- Updated nrf_oberon to v3.0.8.
- Updated Mbed TLS to v2.16.10.

The following toolchains/devices have been used for testing and verification:
 
 - ARM: MDK-ARM version 5.25   
 - GCC: GCC ARM Embedded 9.2020-q2.major
 - IAR: IAR Workbench 7.80.4
 - &lt;span style="background-color:rgba(0, 128, 0, 1);"&gt;SES: SES 5.42a&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit: &lt;/strong&gt;Another solution is to redirect printf to RTT as discussed in this post &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/86110/nrf5-sdk-17-1-0-examples-is-not-compiling-in-latest-ses-6-20a/359669#359669"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/86110/nrf5-sdk-17-1-0-examples-is-not-compiling-in-latest-ses-6-20a/359669#359669&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>