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

RNG Functionalities are not working with SOFT DEVICE

Hi Team,

We are working on NRF52840 module with BLE functionalities.Tested the RNG functionalities alone with example project (examples\peripherals\rng ) it is working fine.When we integrated with our project RNG functionalities are not working.

While running we are getting error code "NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES" from the function "nrf_drv_rng_rand". we have enabled the macro "SOFTDEVICE_PRESENT".

Could any one have idea on this issue, or is there any other way we can integrate the RNG functionalities along with crypto MBDELTS Library. It is very urgent for us to deliver the things to customer.

Regards,

Srinivas.V

Parents Reply Children
  • Hi Einar,

    Thanks for your reply.  But it comes to RNG,  RNG peripheral is different and CC310 RNG  both are different engines.

    If CC310 is available we can use that one only, if not available we can use RNG peripheral with nrf crypto.

    Thanks,

    Srinivas.V

  • Hi Srinivas, 

    Srinivas V said:
    But it comes to RNG,  RNG peripheral is different and CC310 RNG  both are different engines.

    Yes, that is correct.

    Srinivas V said:
    If CC310 is available we can use that one only, if not available we can use RNG peripheral with nrf crypto.

    You can use nrf_crypto as a front end for both the RNG peripheral (all nRF52xxx devices) and the CC310 RNG (only nRF52840).

    Einar

  • HI Einar, 

    Thanks for your reply, if we are going to use the RNG along with crypto(mbedTLS) as front end,

     1. In back ground how RNG will work like interrupt mode or Polling mode along with SD.

     2. SD also using the same RNG peripheral for it's internal use , at that time how it manages with Crypto functionalities.At this time Crypto functions are need to wait until SD releases the RNG peripheral, correct me if i am wrong.

    3. Is there any impact on SD if we are going to use the mbedTLS crypto libraries in my application with respect to timing and other aspects.

    4. If we want to use the mbed TLS crypto along with RNG,what are the macros we need to enable in sdk_config.h file additionally.

    Regards,

    Srinivas.V 

  • Hi Srinivas,

    Srinivas V said:

     1. In back ground how RNG will work like interrupt mode or Polling mode along with SD.

     2. SD also using the same RNG peripheral for it's internal use , at that time how it manages with Crypto functionalities.At this time Crypto functions are need to wait until SD releases the RNG peripheral, correct me if i am wrong.

    The SoftDevice never releases the RNG, so you have to use the SoftDevice APIs to get random data. This always happens by polling (see the three sd_rand_application_*() functions), and not by interrupts. We also provide several layers of abstraction on top of that:

    1. The RNG driver, which allows you to buffer more RNG data and handles the difference between using a SoftDevice and accessing the RNG directly.
    2. The nrf_crypto RNG module which is integrated with other nrf_crypto functionality. This also allows you to use the RNG together with the mbed TLS CTR-DRBG implementation so that the RNG is used for seeding (you can select if you want Raw NRG data or use the CTR-DRBG algorithm using the NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED in sdk_config.h in that case).
    Srinivas V said:
    3. Is there any impact on SD if we are going to use the mbedTLS crypto libraries in my application with respect to timing and other aspects.

    No, not as long as you do your crypto operations in a lower interrupt priority. Typically you will do CPU time consuming operations in a low priority to avoid any issues.

    Srinivas V said:
    4. If we want to use the mbed TLS crypto along with RNG,what are the macros we need to enable in sdk_config.h file additionally.

    If you use the nrf_crypto API (which supports both the RNG as backend and mbed TLS as backend), then you can simply refer to an example. The exact configuration depends on which algorithms and combinations you want to use, as you can see from the nrf_crypto documentation.

    Einar

Related