<?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>RNG Functionalities are not working with SOFT DEVICE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62556/rng-functionalities-are-not-working-with-soft-device</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Jun 2020 10:39:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62556/rng-functionalities-are-not-working-with-soft-device" /><item><title>RE: RNG Functionalities are not working with SOFT DEVICE</title><link>https://devzone.nordicsemi.com/thread/255215?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2020 10:39:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de69ef6d-d98a-4f08-87c8-3cc85f68982a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Srinivas,&lt;/p&gt;
&lt;p&gt;[quote user="Srinivas V"][/quote]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;1. In back ground how RNG will work like interrupt mode or Polling mode along with SD.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;2. SD also using the same RNG peripheral for it&amp;#39;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.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;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&amp;nbsp;sd_rand_application_*() functions), and not by interrupts. We also provide several layers of abstraction on top of that:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The RNG driver, which allows you to buffer more RNG data and handles the difference between using a SoftDevice and accessing the RNG directly.&lt;/li&gt;
&lt;li&gt;The &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_crypto_rng.html"&gt;nrf_crypto RNG module&lt;/a&gt; which is integrated with other nrf_crypto functionality. This also allows you to use the RNG together with the mbed TLS&amp;nbsp;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).&lt;/li&gt;
&lt;/ol&gt;
[quote user="Srinivas V"]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.[/quote]
&lt;p&gt;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.&lt;/p&gt;
[quote user="Srinivas V"]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.[/quote]
&lt;p&gt;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 &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/crypto_examples_nrf_crypto.html"&gt;example&lt;/a&gt;. The exact configuration depends on which algorithms and combinations you want to use, as you can see from the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_crypto.html"&gt;nrf_crypto documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RNG Functionalities are not working with SOFT DEVICE</title><link>https://devzone.nordicsemi.com/thread/255205?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2020 09:53:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0de2ca30-5c1f-4689-897b-8ae3e452a0e6</guid><dc:creator>Srinivas V</dc:creator><description>&lt;p&gt;HI Einar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your reply, if we are going to use the RNG along with crypto(mbedTLS) as front end,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;1. In back ground how RNG will work like interrupt mode or Polling mode along with SD.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;2. SD also using the same RNG peripheral for it&amp;#39;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Srinivas.V&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RNG Functionalities are not working with SOFT DEVICE</title><link>https://devzone.nordicsemi.com/thread/255156?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2020 07:38:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdd7efea-d174-4c7c-be30-4a4800cffecf</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Srinivas,&amp;nbsp;&lt;/p&gt;
[quote user="Srinivas V"]But it comes to RNG,&amp;nbsp; RNG peripheral is different and CC310 RNG&amp;nbsp; both are different engines.[/quote]
&lt;p&gt;Yes, that is correct.&lt;/p&gt;
[quote user="Srinivas V"]If CC310 is available we can use that one only, if not available we can use RNG peripheral with nrf crypto.[/quote]
&lt;p&gt;You can use nrf_crypto as a front end for both the RNG peripheral (all nRF52xxx devices) and the CC310 RNG (only nRF52840).&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RNG Functionalities are not working with SOFT DEVICE</title><link>https://devzone.nordicsemi.com/thread/255050?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 13:45:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:231e2650-40cb-4308-b710-3c2e9690dec0</guid><dc:creator>Srinivas V</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&amp;nbsp; But it comes to RNG,&amp;nbsp; RNG peripheral is different and CC310 RNG&amp;nbsp; both are different engines.&lt;/p&gt;
&lt;p&gt;If CC310 is available we can use that one only, if not available we can use RNG peripheral with nrf crypto.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Srinivas.V&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RNG Functionalities are not working with SOFT DEVICE</title><link>https://devzone.nordicsemi.com/thread/254933?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 09:21:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f424aa95-af89-4b95-ba85-1c602331cb2b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The SoftDevice needs the RNG peripheral, so you cannot use it directly. There are several options, though:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use the SoftDevice RNG API: &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html"&gt;sd_rand_application_vector_get()&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Use the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/hardware_driver_rng.html"&gt;RNG driver&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_crypto_rng.html"&gt;nrf_crypto RNG module&lt;/a&gt; (recommended in most cases)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All of the above use the RNG peripheral (by adding more layers of abstractions). The nrf_crypto RNG module can also use the CC310 RNG on the nRF52840, depending on how you configure the module in sdk_config.h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RNG Functionalities are not working with SOFT DEVICE</title><link>https://devzone.nordicsemi.com/thread/254855?ContentTypeID=1</link><pubDate>Sun, 14 Jun 2020 17:21:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8ace766-7afb-4f29-8ab3-70fee0e29b51</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I just answered a similar question &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/62563/rng-exception-after-ble-initialization"&gt;here&lt;/a&gt;, so my notes might help; maybe&amp;nbsp;&lt;span&gt;look at something like&amp;nbsp;&lt;/span&gt;&lt;em&gt;nrf_crypto_rng_init()&lt;/em&gt;&lt;span&gt;&amp;nbsp;in&amp;nbsp;&lt;/span&gt;&lt;em&gt;nrf_crypto_rng.c&lt;/em&gt;&lt;span&gt;&amp;nbsp;tosee if that makes clear the restrictions&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Access type Definition
// ======================
// Restricted
//   The hardware peripheral is used by the SoftDevice and is outside
//   the application sandbox. When the SoftDevice is enabled, it shall
//   only be accessed through the SoftDevice API. Through this API, the
//   application has limited access.
// Blocked
//   The hardware peripheral is used by the SoftDevice and is outside the
//   application sandbox.
//   The application has no access. Interrupts from blocked peripherals
//   are forwarded to the SoftDevice by the MBR and are not available to
//   the application, even inside a Radio Timeslot API timeslot.
// Open
//   The hardware peripheral is not used by the SoftDevice.
//   The application has full access.
//
// Table 3: Hardware access type definitions
//
// Instance SD Enabled  SD Disabled Restrictions
// ======== ==========  =========== ======================================================
// CLOCK    Restricted    Open
// POWER    Restricted    Open
// BPROT    Restricted    Open
// RADIO    Blocked       Open      Available through the Radio Timeslot API
// TIMER0   Blocked       Open      Available through the Radio Timeslot API
// RTC0     Blocked       Open
// TEMP     Restricted    Open
// RNG      Restricted    Open
// ECB      Restricted    Open
// CCM      Blocked       Open      Available during a Radio Timeslot API
// AAR      Blocked       Open      Available during a Radio Timeslot API
// EGU/SWI1 Restricted    Open      Blocked only when Radio Notification signal is enabled
// Radio    Restricted    Open      Blocked only when Radio Notification signal is enabled
// EGU/SWI5 Blocked       Open
// NVMC     Restricted    Open
// MWU      Restricted    Open      Limitations on use of MWU when SoftDevice is enabled
// FICR     Blocked       Blocked
// UICR     Restricted    Open
// NVIC     Restricted    Open      Use SoftDevice NVIC API for configuration when SoftDevice enable&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>