Code running exception when used CRYS_RndInit()

Hi, I have started with "__nRF5_SDK_17.1.0_ddde560" ble_peripheral>ble-app_uart example code project(ble_app_uart_pca10100_s140).

I work with IAR Embedded Workbench IDE 9.20.2.

I edited the example code for our PCB and logic, and for the first phase, it work well.

In the second phase, I was required to implement the secured connection by Encryption bonding.

I have copied from the  ble_peripheral>ble_app_hrs example code project all "nrf_Crypto" files and "nrf_cc310_09.13.a"

The problem is that I have an HardFaultexception when calling CRYS_RndInit(..)

Thank you.

  • Hi Aharon, 
    I'm not so sure that copy the "nrf_Crypto" files and "nrf_cc310_09.13.a" could make it support encryption bonding. 
    Could you please explain what exactly you want to achieve by "Encryption Bonding" is it normal Bluetooth bonding ? With LE Secure Connection ?
    If it's the case I would suggest to have a look at other example, for example ble_app_hrs LESC is supported in the example. 

  • Hi Hung, thank you for the replay.

    Yes, I mean the "normal Bluetooth bonding with LE Secure Connection".

    1. I have already used the  ble_app_hrs  example. When I copied the peer_manager_init(), I was required also to copy nrf_crypto_xx files for the success of the compilation. So, the peer_manager_init() function that I have used, calls to  CRYS_RndInit()

       

    Could you explain to me please what I miss?

    2. Could you explain please what you mean ble_app_hrs LESC? I have used  "ble_app_hrs"( without LESC naming).

    Thank you.

  • Hi , 

    1. Could you please check if you have selected NRF_CRYPTO_ENABLED and NRF_CRYPTO_BACKEND_CC310_ENABLED = 1 in sdk_config.h and all of the configuration under the same setting ? 

    In addition the following shoudl be selected:

    NRF_CRYPTO_RNG_STATIC_MEMORY_BUFFERS_ENABLED

    NRF_CRYPTO_RNG_AUTO_INIT_ENABLED


    Have you tested the ble_app_hrs, do you have any similar issue ? 
    There is a discussion here that might be related to your issue.

    2. I wanted to say " for example ble_app_hrs. LESC is supported in the example. " The example is "ble_app_hrs"

  • Hi, after a long time of researching I found a solution to my problem. I find some hrs(pca10056_s140) example 
    I did two changes in my pca10100_s140 ble_app_uart project(in addition to the previous code merge for LESC):

    1. Changed my RAM region to 0x20002ce0
    2. Merged iar_startup.s in

    Thank you.

  • Good to know you found the issue. Thanks for sharing the solution. 

    The start address of the application RAM should be sync with what needed by the softdevice as reported in the nrf_sdh_ble_enable() call. 

Related