<?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>How to add Bluetooth in an empty project?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75776/how-to-add-bluetooth-in-an-empty-project</link><description>I am using a nRF52840 with &amp;quot; SEGGER Embedded Studio for ARM 5.10a&amp;quot; and &amp;quot; nRF5_SDK_17.0.0_9d13099 &amp;quot; sdk.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Jun 2021 08:08:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75776/how-to-add-bluetooth-in-an-empty-project" /><item><title>RE: How to add Bluetooth in an empty project?</title><link>https://devzone.nordicsemi.com/thread/313566?ContentTypeID=1</link><pubDate>Fri, 04 Jun 2021 08:08:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9b0ddb7-5a2a-41a0-ac85-8e772fa2a5e1</guid><dc:creator>Venus_Bilandi</dc:creator><description>&lt;p&gt;I have successfully added Bluetooth in my project .&lt;/p&gt;
&lt;p&gt;Here is the step by step guide if any one needs it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Create a folder named nRF_SoftDevices and add these files&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;nrf_sdh.c&lt;/li&gt;
&lt;li&gt;nrf_sdh_ble.c&lt;/li&gt;
&lt;li&gt;nrf_sdh_soc.c&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Create a folder named nRF_BLE and add these files&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;ble_advdata.c&lt;/li&gt;
&lt;li&gt;ble_advertising.c&lt;/li&gt;
&lt;li&gt;ble_conn_params.c&lt;/li&gt;
&lt;li&gt;ble_conn_state.c&lt;/li&gt;
&lt;li&gt;ble_link_ctx_manager.c&lt;/li&gt;
&lt;li&gt;ble_srv_common.c&lt;/li&gt;
&lt;li&gt;nrf_ble_gatt.c&lt;/li&gt;
&lt;li&gt;nrf_ble_qwr.c&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Add following files to nrf_Libraries&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;nrf_pwr_mgmt.c&lt;/li&gt;
&lt;li&gt;nrf_section_iter.c&lt;/li&gt;
&lt;li&gt;nrf_atfifo.c&lt;/li&gt;
&lt;li&gt;nrf_atflags.c&lt;/li&gt;
&lt;li&gt;nrf_sortlist.c&lt;/li&gt;
&lt;li&gt;app_timer2.c&lt;/li&gt;
&lt;li&gt;drv_rtc.c&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In the end&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Create a folder named nRF_BLE_Services and add the file related to services you need.&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;I need &amp;ldquo;nus&amp;rdquo; service so I have added files required for that&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;ble_nus.c&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;strong&gt;Go to Solution &amp;lsquo;project name&amp;rsquo; &amp;nbsp;right click, go to &amp;ldquo;options&amp;rdquo; go to &amp;ldquo;Code&amp;rdquo; go to &amp;ldquo;Preprocessor&amp;rdquo; go to &amp;ldquo;User Include Directories&amp;rdquo; and add the paths to the following folders. These are the path of the folders containing &amp;ldquo;.h&amp;rdquo; files required to clear the build errors.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/5732.Screenshot-_2800_12_2900_.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For me paths were&amp;hellip;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\softdevice\s140\headers&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\softdevice\s140\headers\nrf52&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\drivers_nrf\nrf_soc_nosd&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\timer&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\sortlist&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\mutex&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\atomic_fifo&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\common&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\ble_advertising&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\nrf_ble_gatt&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\nrf_ble_qwr&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\ble_services\ble_nus&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\ble_link_ctx_manager&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\pwr_mgmt&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\sortlist&lt;/p&gt;
&lt;p&gt;E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\softdevice\common E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\examples\peripheral\Lynkgrid_base_ble\nRF_SoftDevice&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Go to Project&amp;lsquo;project name&amp;rsquo;, right click, go to &amp;ldquo;options&amp;rdquo; select &amp;ldquo;Common&amp;rdquo;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;go to &amp;ldquo;Code&amp;rdquo; go to &amp;ldquo;Preprocessor&amp;rdquo; go to &amp;ldquo;Preprocessor Definitions&amp;rdquo; and add the following defines&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-_2800_20_2900_.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;BOARD_PCA10056&lt;/p&gt;
&lt;p&gt;BSP_DEFINES_ONLY&lt;/p&gt;
&lt;p&gt;CONFIG_GPIO_AS_PINRESET&lt;/p&gt;
&lt;p&gt;FLOAT_ABI_HARD&lt;/p&gt;
&lt;p&gt;INITIALIZE_USER_SECTIONS&lt;/p&gt;
&lt;p&gt;NRF52840_XXAA&lt;/p&gt;
&lt;p&gt;NO_VTOR_CONFIG&lt;/p&gt;
&lt;p&gt;NRF_SD_BLE_API_VERSION=7&lt;/p&gt;
&lt;p&gt;S140&lt;/p&gt;
&lt;p&gt;SOFTDEVICE_PRESENT&lt;/p&gt;
&lt;p&gt;APP_TIMER_V2&lt;/p&gt;
&lt;p&gt;APP_TIMER_V2_RTC1_ENABLED&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Go to Project&amp;lsquo;project name&amp;rsquo;, right click, go to &amp;ldquo;options&amp;rdquo; select &amp;ldquo;Common&amp;rdquo; go to &amp;ldquo;Code&amp;rdquo; go to &amp;ldquo;Linker&amp;rdquo; go to &amp;ldquo;Section Placement Macros&amp;rdquo; and set the flash and ram values as given&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4087.Screenshot-_2800_17_2900_.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;FLASH_PH_START=0x0&lt;/p&gt;
&lt;p&gt;FLASH_PH_SIZE=0x100000&lt;/p&gt;
&lt;p&gt;RAM_PH_START=0x20000000&lt;/p&gt;
&lt;p&gt;RAM_PH_SIZE=0x40000&lt;/p&gt;
&lt;p&gt;FLASH_START=0x27000&lt;/p&gt;
&lt;p&gt;FLASH_SIZE=0xd9000&lt;/p&gt;
&lt;p&gt;RAM_START=0x20002ae8&lt;/p&gt;
&lt;p&gt;RAM_SIZE=0x3d518&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Go to Project&amp;lsquo;project name&amp;rsquo;, right click, go to &amp;ldquo;options&amp;rdquo; select &amp;ldquo;Common&amp;rdquo; go to &amp;ldquo;Debug&amp;rdquo; go to &amp;ldquo;Loader&amp;rdquo; go to &amp;ldquo;Additional Load File[0]&amp;rdquo; and add the path to softdevice.hex&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-_2800_19_2900_.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For me it was&amp;hellip;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;E:/nRF5_SDK_17.0.0_9d13099/nRF5_SDK_17.0.0_9d13099/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If you face an error while building the code that look like this&lt;/strong&gt;&lt;strong&gt; Error&lt;/strong&gt; : undefined reference to `__start_sdh_req_observers&amp;#39;&lt;/p&gt;
&lt;p&gt;Replace the &amp;ldquo;flash_placement.xml&amp;rdquo; file of your project with the flash_placement.xml file of the ble_app_template project.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Merger the sdk_config.h file of your project with the sdk_config.h of&amp;nbsp; ble_app_template project. You may need to do some changes in your sdk_config.h file according to requirement. I have made changes related to the &amp;ldquo;nus&amp;rdquo; service I need in my project.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;h1 id="mcetoc_1f7b026st0"&gt;Here are the links that were very helpful to me in solving this problem.&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Fble_sdk_app_template.html&amp;amp;cp=8_1_4_2_2_23"&gt;Nordic Semiconductor Infocenter&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_gsg_ses%2FUG%2Fgsg%2Fprogram_sd_ses.html"&gt;Nordic Semiconductor Infocenter&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/65552/enable-the-use-of-rtc0-rtc1-or-rtc2-in-app_timer2"&gt;(+) Enable the use of RTC0, RTC1 or RTC2 in app_timer2 - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/32381/error-output-spis_pca10056-debug-obj-nrf_sdh-o-rodata-sdh_req_observers-0x0-undefined-reference-to-__start_sdh_req_observers"&gt;Error Output/spis_pca10056 Debug/Obj/nrf_sdh.o:(.rodata.sdh_req_observers+0x0): undefined reference to `__start_sdh_req_observers&amp;#39; - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicPlayground/nRF5x-custom-ble-service-tutorial"&gt;NordicPlayground/nRF5x-custom-ble-service-tutorial (github.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add Bluetooth in an empty project?</title><link>https://devzone.nordicsemi.com/thread/312788?ContentTypeID=1</link><pubDate>Tue, 01 Jun 2021 08:54:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3997b197-365c-4fd1-adff-4be9468250c4</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;nRFgo is deprecated, use &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nc_programmer/UG/nrf_connect_programmer/ncp_introduction.html?cp=10_3_1"&gt;nRF Connect Programmer app&lt;/a&gt; instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add Bluetooth in an empty project?</title><link>https://devzone.nordicsemi.com/thread/312665?ContentTypeID=1</link><pubDate>Mon, 31 May 2021 13:52:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c83b598-9232-4606-8695-660e9ad35df6</guid><dc:creator>Venus_Bilandi</dc:creator><description>&lt;p&gt;I thought so and did the same and already have added the files but I used the example &lt;strong&gt;&amp;quot;ble_app_uart&amp;quot;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But I think it can&amp;#39;t find softdevice.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/3757.Screenshot-_2800_3_2900_.png" /&gt;&lt;/p&gt;
&lt;p&gt;Because when I run code in debug mode as of in screenshot it can&amp;#39;t enable softdevice and goes into exception handler.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/3771.Screenshot-_2800_4_2900_.png" /&gt;&lt;/p&gt;
&lt;p&gt;I found on the forum that first I have to upload a softdevice on the controller. which I understand too.&lt;/p&gt;
&lt;p&gt;and I am using nRFgo for that but it says.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4341.Screenshot-_2800_5_2900_.png" /&gt;&lt;/p&gt;
&lt;p&gt;any way around this?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add Bluetooth in an empty project?</title><link>https://devzone.nordicsemi.com/thread/312658?ContentTypeID=1</link><pubDate>Mon, 31 May 2021 13:33:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09702e1c-68ff-4cba-98c5-70dad6ad72f9</guid><dc:creator>Jared</dc:creator><description>[quote user="Venus_Bilandi"]and at this stage it will be faster for me to add Bluetooth in it rather than vice versa.[/quote]
&lt;p&gt;&amp;nbsp;Not so sure about that&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Venus_Bilandi"]Can you guide me in how to do so[/quote]
&lt;p&gt;For starters, you could compare your project with for example the ble_blinky example and add everything that is related to the softdevice and is missing from your project. The diff function in VS Code would help you alot with this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Good luck&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add Bluetooth in an empty project?</title><link>https://devzone.nordicsemi.com/thread/312647?ContentTypeID=1</link><pubDate>Mon, 31 May 2021 13:07:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27b46b86-da00-4c86-b2ec-a8dee97973aa</guid><dc:creator>Venus_Bilandi</dc:creator><description>&lt;p&gt;Yes, I do understand. I also think it is a better way. But I am at the completion of my project and I need Bluetooth support in my project and at this stage it will be faster for me to add Bluetooth in it rather than vice versa.&lt;/p&gt;
&lt;p&gt;So, Can you guide me in how to do so?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add Bluetooth in an empty project?</title><link>https://devzone.nordicsemi.com/thread/312582?ContentTypeID=1</link><pubDate>Mon, 31 May 2021 09:23:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49fe6cb3-0a19-45d7-9cf0-79d3e07ed8ad</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The general recommendation is to start from an SDK example. Several libraries, drivers and SDK configurations needs to included for the Softdevice to work properly. It&amp;#39;s therefore better to start from an SDK example, for example the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_template.html?cp=8_1_4_2_2_23"&gt;ble_template &lt;/a&gt;project.&lt;/p&gt;
&lt;p&gt;best regards&lt;br /&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>