<?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>Trouble in configuring nrf_ble_lesc.c for PEER MANAGER</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81673/trouble-in-configuring-nrf_ble_lesc-c-for-peer-manager</link><description>Dear Sir, 
 for my nRF52840 application made with the SDK v17.0.2 and S140 Softdevice I&amp;#39;m adding the peer module to a peripheral device example (UART with SAADC with timer based execution) in order to increase the security aspect. 
 Following many different</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Nov 2021 16:24:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81673/trouble-in-configuring-nrf_ble_lesc-c-for-peer-manager" /><item><title>RE: Trouble in configuring nrf_ble_lesc.c for PEER MANAGER</title><link>https://devzone.nordicsemi.com/thread/338851?ContentTypeID=1</link><pubDate>Fri, 12 Nov 2021 16:24:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d320215-fd74-48bd-8e23-0ac46bba7064</guid><dc:creator>STE</dc:creator><description>&lt;p&gt;Dear Simonr,&lt;/p&gt;
&lt;p&gt;thanks for your help.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve see the suggested app because was addressed by many thread through the forum.&lt;/p&gt;
&lt;p&gt;After some attempt finally I was successfully in configuring this feature but was principally a trial and error procedure, so take a look at the compiler error messages and then include the necessary files.&lt;/p&gt;
&lt;p&gt;About the file &lt;em&gt;main.c&lt;/em&gt; I&amp;#39;ve followed what reported at this link:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44658/communication-problems-between-ble_peripheral-and-ble_central-in-nrf52-project/176907#176907"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/44658/communication-problems-between-ble_peripheral-and-ble_central-in-nrf52-project/176907#176907&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and used the peripheral part to modfify my main.c code.&lt;/p&gt;
&lt;p&gt;Other than the source .c files is also necessary add related include path inside the common option of the project then:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1636733285453v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;select the &lt;em&gt;Common&lt;/em&gt; profile:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1636733324992v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;then select &lt;em&gt;Preprocessor&lt;/em&gt; and then select the &lt;em&gt;User include Directories&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1636733388903v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;so by comparing the example design and the own design add the necessary path, in my case was the following ones:&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/crypto&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/crypto/backend/cc310&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/crypto/backend/cc310_bl&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/crypto/backend/cifra&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/crypto/backend/mbedtls&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/crypto/backend/micro_ecc&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/crypto/backend/nrf_hw&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/crypto/backend/nrf_sw&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/crypto/backend/oberon&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/crypto/backend/optiga&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;...&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../components/libraries/stack_info&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;...&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../external/nrf_cc310/include&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../external/nrf_oberon&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../external/nrf_oberon/include&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;../../../../../../external/nrf_tls/mbedtls/nrf_crypto/config&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;and may be some other ones that actually I can not remember, check by comparing with the example file what you have to add and by the error message from the compilation stage.&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;Next step was add the &amp;quot;libnrf_cc310_0.9.13.a lib&amp;quot; to my project source file, this lib is at the following path &amp;quot;..\nRF5_SDK_17.0.2_d674dde\external\nrf_cc310\lib\cortex-m4\hard-float&amp;quot;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;and everty time that an error arise check what source file was missing and add it sequencially.&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;For the ble_nus service, inside the function &lt;em&gt;&lt;strong&gt;ble_nus_init()&lt;/strong&gt;&lt;/em&gt; change the following rows:&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    //add_char_params.read_access  = SEC_OPEN;
    //add_char_params.write_access = SEC_OPEN;
    add_char_params.read_access  = SEC_JUST_WORKS;
    add_char_params.write_access = SEC_JUST_WORKS;
    
    ........
    
    //add_char_params.read_access       = SEC_OPEN;
    //add_char_params.write_access      = SEC_OPEN;
    //add_char_params.cccd_write_access = SEC_OPEN;
    add_char_params.read_access       = SEC_JUST_WORKS ;
    add_char_params.write_access      = SEC_JUST_WORKS ;
    add_char_params.cccd_write_access = SEC_JUST_WORKS ;&lt;/pre&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;Inside the config file set:&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;PEER_MANAGER_ENABLED&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;PM_LESC_ENABLED&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;FDS_ENABLED&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;add following lines to the config files:&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1636733936108v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;in order to include the &lt;em&gt;&lt;strong&gt;nrf_ble_lesc.c&lt;/strong&gt;&lt;/em&gt; file also add the following line to the &lt;em&gt;&lt;strong&gt;sdk_config.h&lt;/strong&gt;&lt;/em&gt; file:&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1636734040342v5.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;It is not possible to add inside the doc for every SDK the necessary dependency file to use? it would be more simple and no time consuming follow the instruction for each module so include the needed file and enable the right switch into the config file, just a suggest.&lt;/p&gt;
&lt;p&gt;Thanks and best regards.&lt;/p&gt;
&lt;p&gt;F.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble in configuring nrf_ble_lesc.c for PEER MANAGER</title><link>https://devzone.nordicsemi.com/thread/338832?ContentTypeID=1</link><pubDate>Fri, 12 Nov 2021 14:29:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4995e473-d31c-47dc-a516-ff46af64e27c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;When it comes to BLE and security, it is generally easier to choose one of the examples already implementing the BLE protocol and peer manager, and then add the peripheral functionalities you would like to use.&lt;/p&gt;
&lt;p&gt;I would suggest checking out &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_gls.html"&gt;the glucose application&lt;/a&gt; for instance which already implements LESC, and add UART and ADC to that one instead.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>