<?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>Properly initializing an nRF51822-DK board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21024/properly-initializing-an-nrf51822-dk-board</link><description>I have an nRF51822-DK board and so far I could not properly grab from the examples a simple thing: is there any specific initialization needed when coding? 
 For example I currently run APP_TIMER_INIT, APP_UART_FIFO_INIT, etc. but should I call some</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 01 Apr 2017 20:09:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21024/properly-initializing-an-nrf51822-dk-board" /><item><title>RE: Properly initializing an nRF51822-DK board</title><link>https://devzone.nordicsemi.com/thread/82142?ContentTypeID=1</link><pubDate>Sat, 01 Apr 2017 20:09:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f80b02b-e087-4912-9e78-1b5fdec0a66b</guid><dc:creator>Lisandro Dami&amp;#225;n Nicanor P&amp;#233;rez Meyer</dc:creator><description>&lt;p&gt;Thanks &lt;strong&gt;a lot&lt;/strong&gt; Jan! Looking at the code you pointed out I already have the pieces together, but it&amp;#39;s at least reassuring I could grasp the small details correctly.&lt;/p&gt;
&lt;p&gt;Thanks again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Properly initializing an nRF51822-DK board</title><link>https://devzone.nordicsemi.com/thread/82141?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2017 20:15:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6df151a-3dc0-4925-875c-d0f17712b46f</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Initialization of HW is done through board definition header file. The &amp;quot;hook&amp;quot; prepared in the SDK is following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All is managed by boards.h file (located in &lt;code&gt;\examples\bsp\&lt;/code&gt; for nRF5 SDK up to V12.1.0 or &lt;code&gt;\components\boards\&lt;/code&gt; for V12.2.0 and newer).&lt;/li&gt;
&lt;li&gt;If you are using one of supported HW boards (or you beard matches some of these) then simply define particular constant in your project (e.g. by &lt;code&gt;-DBOARD_PCAxxxxx&lt;/code&gt; in GCC Makefile) and include &lt;code&gt;boards.h&lt;/code&gt; in all custom source code files you write (where needed).&lt;/li&gt;
&lt;li&gt;If you are using custom HW then use one of these pre-defined header files as example, copy it to your project, rename it to &lt;code&gt;custom_board.h&lt;/code&gt; and edit wherever needed (typically remapped GPIO pins and LF clock source). Then simply remove any BOARD_xxxxx from your project defines and add &lt;code&gt;BOARD_CUSTOM&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is enough to adopt all basic libraries and SDK modules to your HW. There is another part of &amp;quot;customization&amp;quot; and that&amp;#39;s SDK configuration through &lt;code&gt;sdk_config.h&lt;/code&gt; file. You should take \config\sdk_config.h as example and either copy it to your project and edit manually or use some interactive generator with GUI wizard if that&amp;#39;s supported in your IDE (I assume there is something like that but I was not looking for it). That will set all modules like &lt;code&gt;app_uart&lt;/code&gt;, &lt;code&gt;app_fifo&lt;/code&gt;, &lt;code&gt;app_timer&lt;/code&gt;, &lt;code&gt;segger_rtt&lt;/code&gt;, &lt;code&gt;nrf_twi&lt;/code&gt; etc.as you need so then everything should compile without clashes (if you write the file correctly and have all modules in compiler/linker paths of course;).&lt;/p&gt;
&lt;p&gt;Two recommendations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I usually define two custom HW filew in my project: one is &lt;code&gt;custom_board.h&lt;/code&gt; and then some real definitions of my HW (like &lt;code&gt;boardxyz_revA.h&lt;/code&gt;). I leave custom_board.h with structure very close to actual boards.h from SDK (just switch between all known HW definitions based on some project constants defined globally) and all is managed in the end by two global defines &lt;code&gt;BOARD_CUSTOM&lt;/code&gt; and &lt;code&gt;BOARDXYZ_REVA&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;There is even more &amp;quot;complete&amp;quot; sdk_config.h template available in one Q&amp;amp;S on this forum, the one in SDK v13.0.0 has some exotic items missing. However I find it more educative for co-workers on the project to keep sdk_config.h default from SDK and use project-specific defines (typically smaller number of 5-50 items) in &lt;code&gt;app_config.h&lt;/code&gt; file which gets included if you define &lt;code&gt;USE_APP_CONFIG&lt;/code&gt; globally in your project.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>