This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF51822 Le secure connection

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.

But, if you connect using "nRF Connect" on a PC, a DHKEY error (BLE_GAP_SEC_STATUS_DHKEY_FAILURE) will occur.
And connecting with "nRF Connect" on ipad pro results in unspecified error in Public key exchange.

However, I can connect with the module I created.

Any idea what might be happening?
Thanks.

【Development environment】

nRF51822

SDK12.3

Parents
  • Hi,

    The post that you link to describes how to adapt the LESC implementation in SDK 15.3 to fix the security issue that was closed in the Erratum 10734 of the BLE spec. The code changes shown in the post describes what you need to change from the Experimental: BLE LE Secure Connections multirole example, and this is verified to be functional.

    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.

    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.).

  • thank you for your answer.

    Only the connection between modules is confirmed before modifying.
    It worked correctly.

    The same DHKEY error occurs in SDK 12.3 "ble_app_multirole_lesc".

    The evaluation method is connected with LES (module: display only , PC: keybord).

    Sorry, the code can not be disclosed.
    Describes the setting value and sniffer data.
    Please let us know if you have other necessary information.

    [Setting value]
    m_sec_params.bond = true;
    m_sec_params.mitm = true;
    m_sec_params.lesc = true;
    m_sec_params.keypress = false;
    m_sec_params.io_caps = m_io_capabilities;
    m_sec_params.oob = false;
    m_sec_params.min_key_size = 7;
    m_sec_params.max_key_size = 16;
    m_sec_params.kdist_own.enc = 1;
    m_sec_params.kdist_own.id = 1;
    m_sec_params.kdist_peer.enc = 1;
    m_sec_params.kdist_peer.id = 1;

         err_code = pm_sec_params_set (& m_sec_params);
         APP_ERROR_CHECK (err_code);

    【Sniffer data】

    4111.ble_app_multirole_lesc.pcapng

  • Hi,

    m-o said:
    ecc was compiled with cygwin's gcc.

    You must use a cross-compiler that compiles the code for ARM. I suggest you download and install 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 <SDK>components\toolchain\gcc\Makefile.windows and build the micro-ecc library which you use by simply calling "make" in the correct folder for your toolchain under <SDK>\external\micro-ecc\.

    m-o said:
    Compiler: Segger Embedded studio v3.34a

    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 (<SDK>examples\ble_central_and_peripheral\experimental\ble_app_multirole_lesc\pca10028\s130\armgcc\Makefile).

  • Thank you for your reply.
    I was able to approach the solution.

    I checked the operation of “ble_app_multirole_lesc” with IAR and it worked.

    Segger Embedded studio does not work.

    Which folder should I use for the library used in Segger Embedded studio?

    Is there anything strange about the uploaded project file?

    flash_placement.zip

  • Hi,

    m-o said:
    Which folder should I use for the library used in Segger Embedded studio?

    You should use the library file which you can build under <SDK>\external\micro-ecc\nrf51_armgcc, since SES uses GCC as the compiler.

    m-o said:
    Is there anything strange about the uploaded project file?

    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.

  • thank you for your answer.

    I changed to the armgcc library, but the symptom did not change.
    Is there any need to change the SES project file and library makefile?

  • What exactly does the error message(s) you get when you build the project say?

Reply Children
Related