<?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 and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86414/build-and-run-with-segger-embedded-studio-ses-v6-20a-on-nrf5-sdk-17-1-0-and-s140-7-2-0-on-nrf52840</link><description>Hi DevZone, 
 I have recently updated: 
 
 nRF5 SDK to 17.1.0 from 15.3.0 
 S140 to 7.2.0 from 6.1.1 
 SES to v6.20a from 4.16 
 
 The SoftDevice now fails to initialize when using the &amp;quot; Build and Run &amp;quot; option with SES. 
 
 The code initializes without</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Mar 2022 09:24:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86414/build-and-run-with-segger-embedded-studio-ses-v6-20a-on-nrf5-sdk-17-1-0-and-s140-7-2-0-on-nrf52840" /><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360744?ContentTypeID=1</link><pubDate>Wed, 30 Mar 2022 09:24:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7eb8c1d-b371-436a-8431-f5fe21f40a74</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Casper,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As long as you don&amp;#39;t have any sensitive information in this ticket, it is perfectly fine to open it to public. As you say, it may help someone with similar problems.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have the possibility to open private tickets to public (only the other way), so you would need to do that.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360743?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2022 13:42:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfa222c6-a45a-49e2-972c-bd632c5f3d7b</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thank you for getting back to me so quickly.&lt;br /&gt;Ok, as long as the issue is just caused by SES not resetting the chip properly then there should be nothing to worry about for the final product as you say.&lt;/p&gt;
&lt;p&gt;Thank you for the .bat file.&lt;/p&gt;
&lt;p&gt;Would it make sense to make this thread public again in case anyone else is having similar experiences?&lt;/p&gt;
&lt;p&gt;Br. Casper&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360742?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2022 13:30:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e87f12a-6e06-45fe-a48b-e30635518da6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Casper,&lt;/p&gt;
&lt;p&gt;After discussing this with a colleague, we concluded that the issue is not related to the nRF, the SoftDevice or the SDK. It looks like a bug in the Segger Embedded Studio&amp;#39;s debugging firmware. The build and run doesn&amp;#39;t reset the nRF properly, but it is trying to do some &amp;quot;hack&amp;quot; by only resetting the vector table and start the execution again, without actually resetting the chip. The reason this is only triggering now (after your port), and not in the old SDK, and as far as I know (but I may be wrong), not in the other non-freertos examples has to do with timing differences in how the threads are started.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I agree that it is a bug, and an inconvenience, but I don&amp;#39;t think Nordic will reach out to Segger and ask for a patch. It should not cause any issues during production, or for the final product.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you say, the issue is not present &amp;quot;the first time you press build and run&amp;quot;, and the reason for this is that this time, SES will actually program the chip, and then reset it properly after. The second time you press build and run, it will just read the flash to see that it is already programmed, and then it will do the buggy reset thing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For your convenience, you can add this .bat file to your usbd_ble_uart_freertos folder, and run it whenever you want to flash your new FW.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/flash.bat"&gt;devzone.nordicsemi.com/.../flash.bat&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(change it if you want to flash the debug build instead.&lt;/p&gt;
&lt;p&gt;You can then run it from a command line in that folder.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360741?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2022 07:50:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7843b1a1-b742-41a3-837b-ba63f1c313a8</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;Ok.&lt;/p&gt;
&lt;p&gt;Yes, we have only experienced this after using &amp;quot;Build and Run.&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Maybe it is an important detail that rolling back SES to v4.16 removes issue.&lt;/p&gt;
[quote user="Casper Kronborg Pedersen"]We then tried rolling back SES all the way to 4.16. This makes the files I sent you work, as well as our two projects that are being ported. [/quote]
&lt;p&gt;Br. Casper&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360740?ContentTypeID=1</link><pubDate>Mon, 28 Mar 2022 17:23:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29939395-526d-47db-af2e-d7bef0e9a15b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;That would be through me.&lt;/p&gt;
&lt;p&gt;I can ask them, but please be aware that they are currently working on the Softdevice Controller, which is the BLE stack for the nRF Connect SDK, so it may take some more time than usual to get an answer.&lt;/p&gt;
&lt;p&gt;Just to clarify, you have not seen this using any other method than the &amp;quot;build and run&amp;quot; with Segger Embedded Studio, right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360739?ContentTypeID=1</link><pubDate>Mon, 28 Mar 2022 08:26:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73315d9f-7765-4e8b-95ca-5177294ed778</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Sorry for getting back to you so late.&lt;/p&gt;
&lt;p&gt;I would like to ask your SoftDevice team what they think about this, and if they think it could potentially be a symptom of some larger problem, or if we should not worry about it?&lt;/p&gt;
&lt;p&gt;Do you know where I can can get in contact with the SoftDevice team?&lt;/p&gt;
&lt;p&gt;Br. Casper&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360738?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 14:18:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:911c315b-b907-4a1a-8884-e89739064c8b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Casper,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am terribly sorry. For some reason, I have missed the &amp;quot;build and run&amp;quot;. Looking at this ticket now, that is actually quite embarrassing. I guess I just read it as &amp;quot;build and run&amp;quot;, as in build it, and flash it, and one way to do so is to press &amp;quot;F5&amp;quot;, which I usually do.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I see that in SDK 17.1.0, this seems to happen with the ble_app_hrs_freertos example as well.&lt;/p&gt;
&lt;p&gt;However, I can only see it using the &amp;quot;build and run&amp;quot; button from SES. Not when compiling with SES, and then flashing using e.g. nrfjprog. I am not completely sure what&amp;#39;s happening, but I suspect it has to do with the clock. I see that if I comment out your &amp;quot;nrf_drv_clock_init()&amp;quot;, then it hardfaults once, and then starts running normally. I suggest that you keep the&amp;nbsp;nrf_drv_clock_init(), but use something other than SES to flash your application, or use the run and debug.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Seeing as this only is triggered in SES, I am not sure it will be a huge issue. If you mean otherwise, I can contact our softdevice team and try to figure out why the softdevice is not starting, but I suspect there is just some timing issue between the program and the reset being issued by SES.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360737?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 13:36:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab5d9b1f-74d7-45b5-8431-e1108b84f819</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nRF5_5F00_SDK_5F00_17.1.0_5F00_ddde560_5F00_ckp.zip"&gt;devzone.nordicsemi.com/.../nRF5_5F00_SDK_5F00_17.1.0_5F00_ddde560_5F00_ckp.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360736?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 13:18:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6357f0a8-b8a1-49d8-9f30-ce9e87c11b80</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
[quote user="Edvin Holmseth"]from your log it seems that it returns 08 from the initial run, unless the line &amp;quot;app: USBD BLE UART example started is not the first thing that is printed when you run your application (If there are more logs above that).[/quote]
&lt;p&gt;I made sure to show you all of the LOG output.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Edvin Holmseth"]What Hardware are you using? nRF52840 DK?[/quote]
&lt;p&gt;Yes, I have used two separate nRF52840-DK&amp;#39;s to ensure that it is not a faulty board.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Edvin Holmseth"]did you actually try to download the file that you uploaded here?[/quote]
&lt;p&gt;Yes, fresh download and extract of both SDK and the files I sent you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Edvin Holmseth"]Have you tried to run it on another DK (another nRF52840 DK), and/or another computer?&amp;nbsp;[/quote]
&lt;p&gt;I have had two colleagues run it on their PC&amp;#39;s with the same results using both the files I sent you and our own two projects that uses the SDK and s140. They downloaded fresh SDK 17.1.0 and the files I sent you were shared locally but as zipped.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Edvin Holmseth"]Seeing as you are trying to port a project/application, please make sure that you&amp;nbsp;&lt;strong&gt;do not&lt;/strong&gt; copy any files outside the folder that you sent me from the old SDK.&amp;nbsp;[/quote]
&lt;p&gt;That is taken into account. We have two separate projects that are being ported and we are two who checked the .emProject files to make sure that the inclusion of files is strictly 17.1.0 and that we are using fresh unzips.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Edvin Holmseth"]You can also try to delete and reinstall SES (there are some files that are not part of the SDK as well, that you may have changed).&amp;nbsp;[/quote]
&lt;p&gt;&lt;strong&gt;Something that might be causing the problem:&amp;nbsp;&lt;/strong&gt;We then tried rolling back SES all the way to 4.16. This makes the files I sent you work, as well as our two projects that are being ported. Hoorah!&lt;/p&gt;
&lt;p&gt;As soon as we upgrade SES back to 5.64 or 6.20a, the error reappears... Even after fresh unzips of files and SES installs. This has been reproduced on two separate computers.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, sticking with a very old version of SES could be painful and does not seem like the solution..&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;From the images you send me it seems like you are always in debug view using the&amp;nbsp;&lt;strong&gt;&amp;quot;Build and Debug&amp;quot;&lt;/strong&gt; option with SES. &lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Here the error will not appear. &lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Have you tried actually using&amp;nbsp;&lt;strong&gt;&amp;quot;Build and Run&amp;quot; and doing so multiple times in a row?&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A detail I did not mention&lt;/strong&gt; was that the initial &amp;quot;Build and Run&amp;quot; always runs without issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Br. Casper&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Btw: I will upload my entire SDK with the examples removed if they are too big to upload.&lt;/p&gt;
&lt;p&gt;EDIT: Additional info, just using the RESET button on the DK also makes the code run without issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360735?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 09:09:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a380dc00-783e-4918-883a-236f36c6038c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1647852976662v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I added the line &amp;quot;nrf_sdh.c line 214, err code %02x&amp;quot;, err code&amp;quot; outside the if, since it didn&amp;#39;t trigger otherwise:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1647853172816v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;from your log it seems that it returns 08 from the initial run, unless the line &amp;quot;app: USBD BLE UART example started is not the first thing that is printed when you run your application (If there are more logs above that).&lt;/p&gt;
&lt;p&gt;Let us take two steps back. What Hardware are you using? nRF52840 DK? did you actually try to download the file that you uploaded here?&amp;nbsp; (don&amp;#39;t copy it from your already existing project folder, but download it and unzip it) and copy it into an&amp;nbsp;&lt;strong&gt;unmodified SDK v17.1.0&lt;/strong&gt;. Do you still see the same? If so, I find it very strange that we see different behavior if we are running the same FW on the same HW and get two different outcomes. Have you tried to run it on another DK (another nRF52840 DK), and/or another computer?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Seeing as you are trying to port a project/application, please make sure that you&amp;nbsp;&lt;strong&gt;do not&lt;/strong&gt; copy any files outside the folder that you sent me from the old SDK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you try to unzip the file that you uploaded here into another &lt;strong&gt;unmodified&amp;nbsp;&lt;/strong&gt;SDK, and it still works. Please try to think if there are any details that you didn&amp;#39;t mention that you did, other than compiling and running the sample in SES. Even if you think it is not of importance, it may make a difference, such as copying some old files from the old SDK because you thought they were needed.&lt;/p&gt;
&lt;p&gt;You can also try to delete and reinstall SES (there are some files that are not part of the SDK as well, that you may have changed).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If that doesn&amp;#39;t lead anywhere, perhaps you can try to zip your entire SDK and upload it here. You may need to delete the rest of the examples if the file is too big to upload on DevZone.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360734?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 10:58:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93e6bf5f-7e2f-4da9-94cb-fc556c01950c</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;About the additional load file, I did check that as well:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x967/__key/communityserver-discussions-components-files/4/LoaderAdditionalFile.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;Br. Casper&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360733?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 10:52:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7411446e-13cc-48a8-8c4b-e9f035592cd3</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;To get the&amp;nbsp;&lt;strong&gt;nrf_sdh_ble_default_cfg_set()&lt;/strong&gt; function to output any NRF Logs from within I had to enable&amp;nbsp;&lt;strong&gt;NRF_SDH_BLE_LOG_ENABLED&lt;/strong&gt; in sdk_config.h. I also set the Log Level to 4 to get all outputs. As you will see, this provided additional information.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;quot;Build and Debug&amp;quot; - With Extra&amp;nbsp; NRF LOGS:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x1244/__key/communityserver-discussions-components-files/4/BuildAndDebugExtraMessages.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;quot;Build and Run&amp;quot; - With Extra NRF LOGS:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x1296/__key/communityserver-discussions-components-files/4/BuildAndRunExtraMessages.JPG" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry for the many large images and me continuously posting, but I hope this helps clearing things up.&lt;/p&gt;
&lt;p&gt;Br. Casper&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360732?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 10:45:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6de30bb4-8e92-42cb-be4c-16b9e2f4134a</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>[quote user="Edvin Holmseth"]Is the issue still that sd_ble_cfg_set() returns NRF_ERROR_INVALID_STATE?[/quote]
&lt;p&gt;No, it is &lt;strong&gt;nrf_sdh_enable_request(),&lt;/strong&gt; specifically in the nrf_sdh.c file in line 214. Here is a screenshot of an additional log line I just added:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x1392/__key/communityserver-discussions-components-files/4/nrf_5F00_sdh.c._5F00_failureJPG.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Edvin Holmseth"]Are you sure you don&amp;#39;t call ble_stack_init() twice in your project? Or that you call&amp;nbsp;nrf_sdh_ble_default_cfg_set() from several places?[/quote]
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x141/__key/communityserver-discussions-components-files/4/BleStackInit.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x147/__key/communityserver-discussions-components-files/4/NrfSdhBleDefaultCfgSet.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Edvin Holmseth"] Check from your log by adding some logging inside that call to see whether it is called one or two times. [/quote]
&lt;p&gt;I just checked the project to see the amount of times each function is found.&amp;nbsp;&lt;br /&gt;I will add in the log output reply below where I have added the extra log messages inside those function calls.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360731?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 10:16:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:832a9388-7486-420d-9596-e5feaa6d524d</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
[quote user="Edvin Holmseth"]FYI, Segger will flash the softdevice for you, as long as it is specified in project settings -&amp;gt; Loader -&amp;gt; Additional_load_file[0].[/quote]
&lt;p&gt;I was aware that SES was flashing the SoftDevice since the Output log tells me so, but thank you for telling me :) I only used the nRF Connect For Desktop to avoid using SES for flashing as a test.&lt;/p&gt;
&lt;p&gt;I just want to quickly show what I am getting when using&amp;nbsp;&lt;strong&gt;&amp;quot;Build and Debug&amp;quot;:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x1271/__key/communityserver-discussions-components-files/4/BuildAndDebug.JPG" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;quot;Build and Run&amp;quot;:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x1371/__key/communityserver-discussions-components-files/4/BuildAndRun.JPG" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I am using a fresh SDK and the file I sent you. I am just quickly posting this to clarify before I recheck the exact point of failure so you can see the behavior I am experiencing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Br. Casper&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;EDIT: Additional information. I am using REV 2.0.0, 2020.2 of the nRF52840-DK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360730?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 09:53:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e20bf2a8-7e9f-465f-8975-7d642c3784ad</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;FYI, Segger will flash the softdevice for you, as long as it is specified in project settings -&amp;gt; Loader -&amp;gt; Additional_load_file[0].&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I get this when I added one line of printing before entering the task scheduler:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1647596916149v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Other than that, I didn&amp;#39;t modify the file that you sent at all, except clicking &amp;quot;rebuild solution&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is the issue still that sd_ble_cfg_set() returns NRF_ERROR_INVALID_STATE? Are you sure you don&amp;#39;t call ble_stack_init() twice in your project? Or that you call&amp;nbsp;nrf_sdh_ble_default_cfg_set() from several places? Check from your log by adding some logging inside that call to see whether it is called one or two times. And check that sd_ble_default_cfg_set() is not called after&amp;nbsp;sd_ble_enable() is called. And also check that the correct softdevice is located in the folder that the loader is fetching the softdevice from. It doesn&amp;#39;t matter what softdevice you manually program before you press &amp;quot;build and debug&amp;quot; because Segger Embedded Studio will still program the file found in &amp;quot;Additional_load_file[0]&amp;quot;.&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360729?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 07:27:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9a4fed2-80e6-4ed8-868b-18da7f1e360f</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Were you able to reproduce the scenario after trying what I wrote earlier?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="Casper Kronborg Pedersen"]&lt;p&gt;Did you try and flash the S140 7.2.0 .hex file and the .hex file that is built with the files I sent you and then:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Flash both SDK and example project hex files with nRF Connect for Desktop Programmer&lt;/li&gt;
&lt;li&gt;Then open the .emProject file with SES 5.64 and selecting the &amp;quot;&lt;strong&gt;Build and Run&amp;quot;&amp;nbsp;&lt;/strong&gt;option while checking the log output?&lt;/li&gt;&lt;/ul&gt;[/quote]
&lt;p&gt;Br. Casper&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360728?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 07:57:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77aff103-6c82-4dad-a1e9-ff306ce77142</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;Yes, I did download and unzip a clean SDK 17.1.0, and unzipped the file I sent you to the very same location.&lt;br /&gt;Then I got the output I wrote before in green.&lt;br /&gt;&lt;br /&gt;Did you try and flash the S140 7.2.0 .hex file and the .hex file that is built with the files I sent you and then:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Flash both SDK and example project hex files with nRF Connect for Desktop Programmer&lt;/li&gt;
&lt;li&gt;Then open the .emProject file with SES 5.64 and selecting the &amp;quot;&lt;strong&gt;Build and Run&amp;quot;&amp;nbsp;&lt;/strong&gt;option while checking the log output?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Br. Casper&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360727?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 14:36:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d75cb136-57d7-429f-b8f2-6e210bd9fc68</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;You can download the unmodified SDK here:&lt;br /&gt;&lt;a href="https://www.nordicsemi.com/Products/Development-software/nRF5-SDK"&gt;https://www.nordicsemi.com/Products/Development-software/nRF5-SDK&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360726?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 14:35:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f58f0993-b387-4caf-8382-c0394fe62f74</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Did you try to use SES with a clean install of the SDK? Download and unzip the SDK, and unzip the file that you sent me into the very same location that you described in the unmodified SDK.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360725?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 08:49:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0df5ac4-78ef-4644-a2d7-effda746ae8a</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I just installed SES v5.64&lt;/p&gt;
&lt;p&gt;I then erased the flash on the nRF52840-DK, and used nRF Connect for Desktop Programmer to write S140 v7.20 and the usbd_ble_uart_freertos example.&lt;/p&gt;
&lt;p&gt;The issue still persists for me though when using &amp;quot;Build and Run&amp;quot; with SES v5.64.&lt;/p&gt;
&lt;p&gt;I can still make the code run by using &amp;quot;Build and Debug&amp;quot; with SES v5.64 or by using &amp;quot;&lt;span&gt;nRF Connect for Desktop Programmer&amp;quot; to flash the nRF52840-DK as before.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Br. Casper&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360724?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 08:34:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b557eeb2-bccc-4c2d-8aca-1556d223923d</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I just unzipped a fresh SDK 17.1.0, deleted the existing&amp;nbsp;&lt;strong&gt;&lt;span&gt;usbd_ble_uart_freertos&lt;/span&gt;&lt;/strong&gt; example and unzipped the file I sent you. Then I selected Build and Run after making sure the nRF52840-DK already holds the S140 v7.2.0 with nRF Connect.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="color:rgba(0, 0, 0, 1);text-decoration:underline;"&gt;This is the output I get:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(51, 153, 102, 1);"&gt;&amp;lt;info&amp;gt; app: USBD BLE UART example started.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(51, 153, 102, 1);"&gt;&amp;lt;debug&amp;gt; nrf_sdh: State request: 0x00000000&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(51, 153, 102, 1);"&gt;&amp;lt;debug&amp;gt; nrf_sdh: State change: 0x00000000&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(51, 153, 102, 1);"&gt;&amp;lt;info&amp;gt; app: SDH Enable: 8&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(51, 153, 102, 1);"&gt;&amp;lt;info&amp;gt; app: SDH Config: 0, Ram Start: 20002AE8&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(51, 153, 102, 1);"&gt;&amp;lt;info&amp;gt; app: BLE Enable: 8&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(51, 153, 102, 1);"&gt;&amp;lt;debug&amp;gt; nrf_sdh_freertos: Creating a SoftDevice task.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(51, 153, 102, 1);"&gt;&amp;lt;debug&amp;gt; nrf_sdh_freertos: Enter softdevice_task.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(51, 153, 102, 1);"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;However, I am noticing that you are using SES v5.64, and I am using SES v6.20a. I will try and investigate if a rollback of my IDE could solve the issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;Br. Casper&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;EDIT: Did not answer your question&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="Edvin Holmseth"]&lt;p&gt;In my case, line 214 in nrf_sdh.c is:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;a href="#"&gt;Fullscreen&lt;/a&gt;&lt;div style="width:100%;height:14.4px;"&gt;&lt;div&gt;&lt;div style="margin-top:0;height:43.2px;width:40px;"&gt;&lt;div style="height:14.4px;"&gt;1&lt;/div&gt;&lt;/div&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="left:40px;right:0;bottom:0;"&gt;&lt;div style="margin-top:0;width:568px;height:43.2px;margin-left:0;"&gt;&lt;div&gt;&lt;div style="left:531.82px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div style="padding:0 4px;"&gt;&lt;div style="height:14.4000005722046px;"&gt;&lt;span&gt;ret_code&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;sd_softdevice_enable&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;clock_lf_cfg&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;app_error_fault_handler&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="left:4px;top:0;width:6.59775px;height:14.4px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="display:none;width:22px;bottom:0;"&gt;&lt;div style="width:22px;height:14.4px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="display:none;height:22px;left:40px;right:0;"&gt;&lt;div style="height:22px;width:568px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="height:auto;width:auto;top:0;left:0;white-space:pre;overflow:hidden;"&gt;&lt;div style="height:auto;width:auto;top:0;left:0;white-space:pre;overflow:visible;"&gt;&lt;/div&gt;&lt;div style="height:auto;width:auto;top:0;left:0;white-space:pre;font-style:inherit;font-size:inherit;line-height:inherit;font-family:inherit;overflow:visible;"&gt;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="overflow:auto;"&gt;&lt;pre style="display:none;"&gt;ret_code = sd_softdevice_enable(&amp;amp;clock_lf_cfg, app_error_fault_handler);&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is that the case for you as well?&lt;/p&gt;[/quote]
&lt;p&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;Yes this is the same line for me.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360723?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 08:10:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2c39983-fd3b-47a6-8a0e-b9319385d5d6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;In my case, line 214 in nrf_sdh.c is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret_code = sd_softdevice_enable(&amp;amp;clock_lf_cfg, app_error_fault_handler);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Is that the case for you as well?&lt;/p&gt;
&lt;p&gt;Also, in my case, this returns NRF_SUCCESS when I compiled and ran your project. If you get something else, perhaps you can try to unzip the file that you just sent me into an unmodified SDK17.1.0, in case you changed something without being aware of it. See if it still returns NRF_ERROR_INVALID_STATE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note:&lt;/p&gt;
&lt;p&gt;It didn&amp;#39;t compile right away, with some weird compiler error. When I used &amp;quot;Rebuild solution&amp;quot; it compiled without errors.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1647331821258v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360722?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 11:33:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17ae9066-23bb-4e00-9a73-719658caaebe</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Migration Guides:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I did look at migration guides from 15.3.0 to 16.0.0 and then from 16.0.0 to 17.0.2 of the SDK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;RAM and FLASH:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have used the RAM and flash placements from the usbd_ble_uart_freertos example and that allowed the project to build after migration. However, I did not know that the RAM settings were dependent on the specific use case of S140.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Error in my statement in the &amp;quot;Update&amp;quot; post:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I thought that I had gotten an example from the SDK working without any issues, however I must have been tired as I simply did not get the LOG output with the errors... So I never had a working example project from the SDK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sharing an example to run on a nRF52840-DK that reproduces the error:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have used the&amp;nbsp;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;usbd_ble_uart_freertos&lt;/span&gt;&lt;/strong&gt; example from SDK 17.1.0, and enabled all NRF logging for the SoftDevice, as well as added my own outputs to the&amp;nbsp;&lt;strong&gt;ble_stack_init()&amp;nbsp;&lt;/strong&gt;function and added that to a .zip library.&lt;/p&gt;
&lt;p&gt;To get it to run, you should be able to go to:&lt;/p&gt;
&lt;p&gt;&amp;lt;SDK Location on your PC&amp;gt;\nRF5_SDK_17.1.0_ddde560\examples\peripheral\&lt;/p&gt;
&lt;p&gt;And unpack the .zip file. I built the version for pca10056, SES and S140 located here:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;SDK Location on your PC&amp;gt;&lt;/span&gt;\nRF5_SDK_17.1.0_ddde560\examples\peripheral\usbd_ble_uart_freertos\pca10056\s140\ses&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As I wrote in the original post, the error only shows when using the &amp;quot;Build and Run&amp;quot; option in SEGGER Embedded Studio.&lt;/p&gt;
&lt;p&gt;From what I can see, it is&amp;nbsp;&lt;strong&gt;Line 214 in nrf_sdh.c&lt;/strong&gt; that returns&amp;nbsp;&lt;strong&gt;NRF_ERROR_INVALID_STATE.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Hope this is something you can work with.&lt;/p&gt;
&lt;p&gt;Br. Casper&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/usbd_5F00_ble_5F00_uart_5F00_freertos.zip"&gt;devzone.nordicsemi.com/.../usbd_5F00_ble_5F00_uart_5F00_freertos.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; &lt;br /&gt;To make it build I assume you also need to change a line in retarget.c like I had to.&lt;br /&gt;retarget.c line 100 changed to:&amp;nbsp;&lt;br /&gt;#if defined(__SES_VERSION) &amp;amp;&amp;amp; (__SES_VERSION &amp;gt;= 34000) &amp;amp;&amp;amp; !defined(__SEGGER_RTL_VERSION)&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360721?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 14:24:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60751b6f-efd4-40bc-b64c-d80ad133bf7e</guid><dc:creator>Edvin</dc:creator><description>[quote user="Casper Kronborg Pedersen"]Could this&amp;nbsp;mean that the difference might lie in&amp;nbsp;defines in the sdk_config.h header file?[/quote]
&lt;p&gt;It could be, but my main suspicion, and why I asked about the NRF_LOG_WARNING lines is that when you change the softdevice, it will typically require some other memory settings than what it did in the old SDK. I will change this ticket to private now.&lt;/p&gt;
[quote user="Casper Kronborg Pedersen"]&lt;p&gt;Are any changes needed to that file to make things work as intended when updating the SDK version?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;You should see the&amp;nbsp;migration guide for the SDK versions between 15.3.0 and 17.1.0.&lt;/p&gt;
&lt;p&gt;If you took the project file from the old SDK, then you need to make sure that you upload the new SoftDevice from the new SDK, and you probably need to change flash start address, flash size, ram start address and ram size to match your new SoftDevice.&lt;/p&gt;
&lt;p&gt;For Flash, just see what flash start address and size the other examples in the SDK that uses the same softdevice uses, while for RAM, you need to monitor the log, or debug and set breakpoints at those points to see if it wants you to change the RAM settings. The reason I can&amp;#39;t just tell you what to set is that it depends on the application you are running, the number of services and characteristics, the connection parameters that you intend to use, the MTU size, the number of supported simultaneous connections and so on.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Build and Run with SEGGER Embedded Studio (SES) v6.20a on nRF5 SDK 17.1.0 and S140 7.2.0 on nRF52840</title><link>https://devzone.nordicsemi.com/thread/360720?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 13:36:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a859bb9-8ded-4fb6-bd2c-adee40f89192</guid><dc:creator>Casper Kronborg Pedersen</dc:creator><description>&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Update:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I found&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/85405/nrf5-sdk-17-1-0-examples-is-not-compiling-in-latest-ses-6-20a/"&gt;this thread&lt;/a&gt;&amp;nbsp;which enabled me to build the&amp;nbsp;&lt;strong&gt;usbd_ble_uart_freertos_pca10056_s140&lt;/strong&gt;&amp;nbsp;SDK example from SDK 17.1.0 by changing line 100 in retarget.c.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Then I tried the following on an nRF52840-DK:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I removed all features from the SDK example that are not used in our own project and then I was able to start s140 without doing power cycles, using the debugger or any of the other methods.&lt;/li&gt;
&lt;li&gt;Then I removed all features and initialization in the main() function except nrf_log and s140 from our own project and used the exact same sequence of function calls as in the SDK example. But the problem still exists.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could this&amp;nbsp;mean that the difference might lie in&amp;nbsp;defines in the sdk_config.h header file?&lt;/p&gt;
&lt;p&gt;I am running with the same sdk_config.h as before the change from SDK 15.3.0 to 17.1.0.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Are any changes needed to that file to make things work as intended when updating the SDK version?&lt;/p&gt;
&lt;p&gt;I am currently investigating the differences between the files.&lt;/p&gt;
&lt;p&gt;Br. Casper&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>