<?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>nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50618/nrf51822-le-secure-connection</link><description>Hello all. 
 
 I am developing a BT4.2 compliant application. I have a question about LESC (LE Secure Connection). 
 devzone.nordicsemi.com/.../how-to-implement-ecc-functions-on-sdk-v12- 3-0-and-nrf51822 / 142314 # 142314 I had add the above process.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Aug 2019 07:42:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50618/nrf51822-le-secure-connection" /><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/204921?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 07:42:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c652abbc-379a-43d5-95e6-959ec72b200d</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;Sorry, the above was unnecessary.&lt;/p&gt;
&lt;p&gt;The cause has been found.&lt;br /&gt;uECC.c was not working because it was included in the compilation.&lt;/p&gt;
&lt;p&gt;Thank you for your cooperation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/204193?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2019 06:29:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1e0c86a-a746-42a1-8743-b669ac824e18</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;No. Why do you ask?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/204140?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2019 15:29:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:482a43ee-c6ea-4045-90a6-4d3b2c0052d5</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;Thank you for the test function.&lt;/p&gt;
&lt;p&gt;I will check it.&lt;/p&gt;
&lt;p&gt;Have you changed thumb_crt0.s?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203811?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 11:55:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b216bbd1-82cb-43c1-b0cb-3bfaf342167b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I understand (I had a vague understanding that&amp;nbsp;you were using Keil as well, but that was probably just for testing this).&lt;/p&gt;
&lt;p&gt;I was not able to test the way you describe since for some reason I did not see the advertisement packets on air. Since you reported that the issue was specifically with the calculation of the shared secret I instead put together a simple test function that verifies the crypto operations needed for LESC,&amp;nbsp;which you can see here (and run yourself by copy-pasting into your code and calling from your main function):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Test crypto functions needed for LESC. To be used in the ble_app_multirole_lesc example in SDK 12.3.
static void crypto_test(void)
{
    ret_code_t err_code;

    // Own key structures
    __ALIGN(4) static const ble_gap_lesc_p256_sk_t sk =
    {{
        0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
        0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
        0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
        0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
    }};
    __ALIGN(4) static ble_gap_lesc_p256_pk_t lesc_pk;    /**&amp;lt; LESC ECC Public Key */
    __ALIGN(4) static ble_gap_lesc_dhkey_t lesc_dhkey;   /**&amp;lt; LESC ECC DH Key */

    static nrf_crypto_key_t own_sk =
    {
        .p_le_data = (uint8_t *) sk.sk,
        .len = sizeof(sk.sk)
    };
    static nrf_crypto_key_t own_pk =
    {
        .p_le_data = (uint8_t *) lesc_pk.pk,
        .len = sizeof(lesc_pk.pk)
    };
    static nrf_crypto_key_t key_dhkey =
    {
        .p_le_data = (uint8_t *) lesc_dhkey.key,
        .len = sizeof(lesc_dhkey.key)
    };

    // Valid own public key
    __ALIGN(4) static const uint8_t valid_own_pk[] =
    {
        0x02, 0x17, 0xE6, 0x17, 0xF0, 0xB6, 0x44, 0x39,
        0x28, 0x27, 0x8F, 0x96, 0x99, 0x9E, 0x69, 0xA2,
        0x3A, 0x4F, 0x2C, 0x15, 0x2B, 0xDF, 0x6D, 0x6C,
        0xDF, 0x66, 0xE5, 0xB8, 0x02, 0x82, 0xD4, 0xED,
        0x19, 0x4A, 0x7D, 0xEB, 0xCB, 0x97, 0x71, 0x2D,
        0x2D, 0xDA, 0x3C, 0xA8, 0x5A, 0xA8, 0x76, 0x5A,
        0x56, 0xF4, 0x5F, 0xC7, 0x58, 0x59, 0x96, 0x52,
        0xF2, 0x89, 0x7C, 0x65, 0x30, 0x6E, 0x57, 0x94,
    };

    // Peer public key structures
    __ALIGN(4) static const uint8_t peer_raw_public_key[] =
    {
        0xA5, 0x62, 0xBD, 0x02, 0x60, 0x88, 0x81, 0x2E,
        0x0A, 0x26, 0xE6, 0xA3, 0x55, 0x0E, 0xFA, 0xC6,
        0x06, 0xE6, 0x91, 0xDE, 0xB5, 0x6F, 0xA2, 0x1B,
        0x19, 0x8F, 0x2E, 0xFD, 0x0B, 0xD5, 0xCB, 0x25,
        0x9B, 0x4A, 0x96, 0x09, 0x12, 0xFD, 0x30, 0xD8,
        0x79, 0xA4, 0x52, 0x47, 0xF8, 0x05, 0x08, 0xE1,
        0x33, 0x3C, 0xA2, 0x5A, 0x4B, 0x83, 0x26, 0x23,
        0x3A, 0xE8, 0x26, 0x82, 0x46, 0x5A, 0x21, 0xCD,
    };

    static nrf_crypto_key_t peer_pk =
    {
        .p_le_data = (uint8_t *) peer_raw_public_key,
        .len = sizeof(peer_raw_public_key)
    };

    // Compare shared secret with valid shared secret
        __ALIGN(4) static const uint8_t valid_shared_secret[] =
    {
        0x6C, 0x21, 0xB1, 0xAB, 0xCF, 0x65, 0xFC, 0xB7,
        0x50, 0x48, 0xF2, 0x1B, 0x43, 0xA5, 0x31, 0x22,
        0xF8, 0x13, 0x65, 0x17, 0x02, 0x71, 0x5E, 0xBE,
        0xD2, 0x77, 0xFD, 0xB8, 0xA2, 0x4C, 0x5E, 0x73,
    };

    // -------------------------------- Begin test --------------------------------

    NRF_LOG_INFO(&amp;quot;Test crypto operations used for LESC...\r\n&amp;quot;);

    // Calculate own public key (not really needed in this test since we will not pass to a peer in
    // this test) but it is done to verify that it works since it is used in the real LESC procedure.
    nrf_crypto_init();
    err_code = nrf_crypto_public_key_compute(NRF_CRYPTO_CURVE_SECP256R1, &amp;amp;own_sk, &amp;amp;own_pk);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_INFO(&amp;quot;Calculated public key:\r\n&amp;quot;);
    NRF_LOG_HEXDUMP_INFO(own_pk.p_le_data, own_pk.len);

    // Compare with valid public key
    if (memcmp(own_pk.p_le_data, valid_own_pk, 64) == 0)
    {
        NRF_LOG_INFO(&amp;quot;Calculated public key is correct.\r\n&amp;quot;);
    }
    else
    {
        NRF_LOG_ERROR(&amp;quot;Fail: Calculated public key is INCORRECT!\r\n&amp;quot;);
    }

    // Calculate shared secret
    err_code = nrf_crypto_shared_secret_compute(NRF_CRYPTO_CURVE_SECP256R1, &amp;amp;own_sk, &amp;amp;peer_pk, &amp;amp;key_dhkey);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_INFO(&amp;quot;Calculated shared secret:\r\n&amp;quot;);
    NRF_LOG_HEXDUMP_INFO(key_dhkey.p_le_data, key_dhkey.len);

    // Compare with valid shared secret
    if (memcmp(key_dhkey.p_le_data, valid_shared_secret, 32) == 0)
    {
        NRF_LOG_INFO(&amp;quot;Calculated shared secret is correct.\r\n&amp;quot;);
    }
    else
    {
        NRF_LOG_ERROR(&amp;quot;Fail: Calculated shared secret is INCORRECT!\r\n&amp;quot;);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Interestingly this test passes in your SES project, so there does not seem to be any problems with&amp;nbsp;mciro-ecc. I don&amp;#39;t know why LESC files when you test, nor do I know why I don&amp;#39;t even see the advertisement packets on air on my side. Everything else looks OK to me. So it is a bit of a mystery for now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203696?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 21:44:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c4d3dd1-96a4-4f2d-9a4c-9dce0223d2fc</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;Thank you for the survey.&lt;/p&gt;
&lt;p&gt;Since development has ended,I cannot be changed to KEIL.&lt;/p&gt;
&lt;p&gt;Has the symptom reproduced?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203606?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 13:09:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f10172aa-8058-4e82-8767-cdf9250366d0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have been looking into this, but I do not yet understand what is going on. Is it OK for you to keep using Keil in the meantime?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203236?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 09:00:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e78de7e-d832-4306-bad5-02f36c1245f9</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;thank you for your answer.&lt;/p&gt;
&lt;p&gt;For my test, connect the board of DK (bRF52832) and nRF51822 according to the following procedure.&lt;/p&gt;
&lt;p&gt;1. Connect DK to PC&lt;/p&gt;
&lt;p&gt;2. Start &amp;quot;nRF Connect for Desk top&amp;quot; and select DK.&lt;/p&gt;
&lt;p&gt;3. Write the firmware to the nRF51822 board.&lt;/p&gt;
&lt;p&gt;4. Connect nRF51822 board (peripheral) and DK (central).&lt;/p&gt;
&lt;p&gt;5. Pair using LESC.&lt;br /&gt;&amp;rarr; DHKEY error occurs&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203217?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 07:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2b53890-b148-4680-92a3-5c973678f30f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see. I tested with SES and then it seems to run. What is the test procedure (how do I get the DK to connect to something)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203139?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 15:00:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1277c34b-bd23-48b6-962c-21ede998c0f9</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;No, I don&amp;#39;t want to know general transplantation methods.&lt;/p&gt;
&lt;p&gt;Confirmed that uploaded project is connected with peripheral&lt;/p&gt;
&lt;p&gt;What I want to know is that reason DHKEY errors do not occur in IAR and DHKEY errors occur in SES.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203088?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 13:14:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e442577-2c2d-4bb1-bd3c-11ceae4184b7</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I just tested briefly, and the SES project seems to have other issues as well (I don&amp;#39;t see the two LED&amp;#39;s lit, which I do with your Keil project). Do you have a SES project that was working except for the LESC DHkey calculation, or is this question more about porting a SDK 12.3 Keil project to SES in general?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203032?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 10:46:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:052c5fd9-36cc-4532-83fd-805ce90e22bf</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;Thank you for checking everything&lt;/p&gt;
&lt;p&gt;A complete project has been uploaded.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nRF5_5F00_SDK_5F00_12.3.0_5F00_d7731ad_5F00_2.zip"&gt;devzone.nordicsemi.com/.../nRF5_5F00_SDK_5F00_12.3.0_5F00_d7731ad_5F00_2.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203026?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 10:21:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6eda516-7f11-49e7-a8ed-3662d16d13de</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Can you upload the complete project with everything together so that I can build and test on my side? Please package everything together so that I can test out of the box.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203016?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 09:53:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00374fea-6cf5-4b9c-94e2-9f0ff9eb52b1</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;There is no warning.&lt;/p&gt;
&lt;p&gt;Do you have the necessary information and files?&lt;/p&gt;
&lt;p&gt;Upload the created library file.&lt;br /&gt;Is there a difference there?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2630.micro_5F00_ecc_5F00_lib_5F00_nrf51.a"&gt;devzone.nordicsemi.com/.../2630.micro_5F00_ecc_5F00_lib_5F00_nrf51.a&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203005?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 09:28:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea48c244-b0c7-40ef-abc7-211a69a4172d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. Not even warnings during linking? It is odd that the library just fails silently...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/203004?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 09:25:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d79cf4a-6a99-4683-bb30-e4d43abcfab2</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry, it seems that the writing was not good.&lt;br /&gt;&lt;br /&gt;No error occurred in the build.&lt;br /&gt;What is occurring is a DHKEY error.&lt;br /&gt;&lt;br /&gt;I wanted to check if it was necessary to change the compile options to improve the DHKEY error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/202998?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 09:12:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd678fe3-4f65-42fe-b27c-3d3a854ab1ce</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;What exactly does the error message(s) you get when you build the project say?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/202993?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 09:03:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9964c89-a8e1-4ef1-aec7-d8eef4ae5de6</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;thank you for your answer.&lt;/p&gt;
&lt;p&gt;I changed to the armgcc library, but the symptom did not change.&lt;br /&gt;Is there any need to change the SES project file and library makefile?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/202953?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 06:30:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc0b79fe-9bd6-4237-834f-6cc72f3515ba</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="m-okabe"]Which folder should I use for the library used in Segger Embedded studio?[/quote]
&lt;p&gt;You should use the library file which you can build under &amp;lt;SDK&amp;gt;\external\micro-ecc\nrf51_armgcc, since SES uses GCC as the compiler.&lt;/p&gt;
[quote user="m-okabe"]Is there anything strange about the uploaded project file?[/quote]
&lt;p&gt;There is at least a problem that you use the wrong library file for micro-ecc. I see that you use /external/micro-ecc/nrf51_keil/armgcc/micro_ecc_lib_nrf51.lib, which is not suitable with GCC. There might be other problems that I have not spotted as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/202718?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2019 02:51:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d728dfd9-c806-4c1a-a1fc-c2a58ddcc1ba</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;Thank you for your reply.&lt;br /&gt;I was able to approach the solution.&lt;/p&gt;
&lt;p&gt;I checked the operation of &amp;ldquo;ble_app_multirole_lesc&amp;rdquo; with IAR and it worked.&lt;/p&gt;
&lt;p&gt;Segger Embedded studio does not work.&lt;/p&gt;
&lt;p&gt;Which folder should I use for the library used in Segger Embedded studio?&lt;/p&gt;
&lt;p&gt;Is there anything strange about the uploaded project file?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/flash_5F00_placement.zip"&gt;devzone.nordicsemi.com/.../flash_5F00_placement.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/202572?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 10:38:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:add21532-95b7-4aeb-ab23-838dfcf9f10d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="m-okabe"]ecc was compiled with cygwin&amp;#39;s gcc.[/quote]
&lt;p&gt;You must use a cross-compiler that compiles the code for ARM. I suggest you download and install&amp;nbsp;GNU Tools ARM Embedded 4.9 2015q3, as that is the toolchain that was tested with SDK 12.3. Then set the correct path in &amp;lt;SDK&amp;gt;components\toolchain\gcc\Makefile.windows and build the micro-ecc library which you use by simply calling &amp;quot;make&amp;quot; in the correct folder for your toolchain under &amp;lt;SDK&amp;gt;\external\micro-ecc\.&lt;/p&gt;
[quote user="m-okabe"]Compiler: Segger Embedded studio v3.34a[/quote]
&lt;p&gt;SES was not supported in 12.3, and while it is possible to use it requires a bit of tweaking, so it could also be related. If you still have problems after building micro-ecc properly, I suggest you try to build with another toolchain (for instance Make with arm gcc) and check if you get the same behavior. The SDK provides a Makefile for the multirole LESC example project that works out of the box (&amp;lt;SDK&amp;gt;examples\ble_central_and_peripheral\experimental\ble_app_multirole_lesc\pca10028\s130\armgcc\Makefile).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/202565?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 10:05:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37b0c3a1-713f-498c-83cd-c2bc5a098227</guid><dc:creator>m-o</dc:creator><description>&lt;div class="frame"&gt;
&lt;div class="page tlid-homepage homepage translate-text"&gt;
&lt;div class="homepage-content-wrap"&gt;
&lt;div class="tlid-source-target main-header small-font"&gt;
&lt;div class="source-target-row"&gt;
&lt;div class="tlid-input input has-transliteration"&gt;
&lt;div class="tlid-language-bar ls-wrap"&gt;
&lt;div class="sl-wrap"&gt;
&lt;div class="sl-sugg"&gt;
&lt;div class="ls-right-arrow"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="source-wrap"&gt;
&lt;div class="input-full-height-wrapper tlid-input-full-height-wrapper"&gt;
&lt;div class="source-input"&gt;
&lt;div class="source-footer-wrap source-or-target-footer"&gt;
&lt;div class="source-footer"&gt;
&lt;div class="src-tts left-positioned ttsbutton jfk-button-flat source-or-target-footer-button jfk-button"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="tlid-results-container results-container"&gt;
&lt;div class="tlid-result result-dict-wrapper"&gt;
&lt;div class="result tlid-copy-target"&gt;
&lt;div class="result-header"&gt;
&lt;div class="starbutton jfk-button-flat jfk-button unstarred"&gt;
&lt;div class="jfk-button-img"&gt;thank you for your answer.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="text-wrap tlid-copy-target"&gt;
&lt;div class="result-shield-container tlid-copy-target"&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;br /&gt;&lt;span title=""&gt;Even if &amp;quot;ble_app_multirole_lesc&amp;quot; that does not change the BLE processing is used, a DHKEY error occurred.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span title=""&gt;Is there a problem with the development environment and tool settings?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="" title=""&gt;【Development environment】&lt;/span&gt;&lt;br /&gt;&lt;span class="" title=""&gt;Compiler: Segger Embedded studio v3.34a&lt;/span&gt;&lt;br /&gt;&lt;span class="" title=""&gt;* KEIL project has been changed.&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="" title=""&gt;The project file could not be uploaded&lt;/span&gt;&lt;br /&gt;&lt;span title=""&gt;ecc was compiled with cygwin&amp;#39;s gcc.&lt;/span&gt;&lt;/span&gt;&lt;span class="tlid-translation-gender-indicator translation-gender-indicator"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="tlid-result-transliteration-container result-transliteration-container transliteration-container"&gt;
&lt;div class="tlid-transliteration-content transliteration-content full"&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/528486.main.c"&gt;devzone.nordicsemi.com/.../528486.main.c&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4520.micro_5F00_ecc_5F00_lib_5F00_nrf51.lib"&gt;devzone.nordicsemi.com/.../4520.micro_5F00_ecc_5F00_lib_5F00_nrf51.lib&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/202551?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 09:09:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ec81adb-71f7-422a-9ec5-38be6ee4c2ee</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;From the sniffer trace, I see that Authentication stage 1 commences as expected, but authentication stage 2 (DHKey checks) fails. This indicates that there was a problem with the DHKey calculation, and therefore both peers do not have the same key.&lt;/p&gt;
&lt;p&gt;Your configuration (of m_sec_params) is identical with the unmodified multirole example, except that you use to display only for IO capabilities. I tested this on my side now, using nRF Connect on a PC and it works as expected.&lt;/p&gt;
&lt;p&gt;What other modifications have you done to the example? Have you done any changes to the handling of the BLE_GAP_EVT_LESC_DHKEY_REQUEST event, where the key (shared secret) is calculated? Can you test again using an unmodified example, where the &lt;em&gt;only&lt;/em&gt; modification is the io capabilities?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/202357?ContentTypeID=1</link><pubDate>Mon, 05 Aug 2019 09:11:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1153e11a-2010-42ae-b5f2-ad57536f9f98</guid><dc:creator>m-o</dc:creator><description>&lt;p&gt;thank you for your answer.&lt;/p&gt;
&lt;p&gt;Only the connection between modules is confirmed before modifying.&lt;br /&gt;It worked correctly.&lt;/p&gt;
&lt;p&gt;The same DHKEY error occurs in SDK 12.3 &amp;quot;ble_app_multirole_lesc&amp;quot;.&lt;/p&gt;
&lt;p&gt;The evaluation method is connected with LES (module: display only , PC: keybord).&lt;/p&gt;
&lt;p&gt;Sorry, the code can not be disclosed.&lt;br /&gt;Describes the setting value and sniffer data.&lt;br /&gt;Please let us know if you have other necessary information.&lt;/p&gt;
&lt;p&gt;[Setting value]&lt;br /&gt;m_sec_params.bond = true;&lt;br /&gt;m_sec_params.mitm = true;&lt;br /&gt;m_sec_params.lesc = true;&lt;br /&gt;m_sec_params.keypress = false;&lt;br /&gt;m_sec_params.io_caps = m_io_capabilities;&lt;br /&gt;m_sec_params.oob = false;&lt;br /&gt;m_sec_params.min_key_size = 7;&lt;br /&gt;m_sec_params.max_key_size = 16;&lt;br /&gt;m_sec_params.kdist_own.enc = 1;&lt;br /&gt;m_sec_params.kdist_own.id = 1;&lt;br /&gt;m_sec_params.kdist_peer.enc = 1;&lt;br /&gt;m_sec_params.kdist_peer.id = 1;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = pm_sec_params_set (&amp;amp; m_sec_params);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK (err_code);&lt;/p&gt;
&lt;p&gt;【Sniffer data】&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4111.ble_5F00_app_5F00_multirole_5F00_lesc.pcapng"&gt;devzone.nordicsemi.com/.../4111.ble_5F00_app_5F00_multirole_5F00_lesc.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 Le secure connection</title><link>https://devzone.nordicsemi.com/thread/202341?ContentTypeID=1</link><pubDate>Mon, 05 Aug 2019 08:37:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c240b30-593f-4cac-bc54-26e491c9ab8d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37035/how-to-implement-ecc-functions-on-sdk-v12-3-0-and-nrf51822/142314#142314"&gt;post that you link to&lt;/a&gt; describes how to adapt the LESC implementation in SDK 15.3 to fix the security issue that was closed in the &lt;a href="https://www.bluetooth.com/specifications/errata/"&gt;Erratum 10734 of the BLE spec&lt;/a&gt;. The code changes shown in the post describes what you need to change from the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/ble_sdk_app_multirole_lesc.html?cp=5_5_7_4_2_1_2"&gt;Experimental: BLE LE Secure Connections multirole example&lt;/a&gt;, and this is verified to be functional.&lt;/p&gt;
&lt;p&gt;Did your LESC implementation work before you started to modify it according to the post, or did it never work? If not, I suggest you first try to implement LESC in the same way as is done in the SDK example and only modify it further once it is working. The modification itself is straight-forward (just copy-paste as described in the post), but it is better to do one step at a time.&lt;/p&gt;
&lt;p&gt;If you still need assistance after that, please elaborate on what you have done, (show your code, describe how you have tested and how it behaves, etc.).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>