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

RNG exception AFTER BLE initialization

I am having a problem using the Random Number Generator AFTER the BLE driver is initialized.  I have traced this to an exception being thrown if I access any RNG registers.

I am able to use the RNG if I don’t use BLE.

 I found a comment in the documentation that states that after initializing the BLE, “Some peripherals will be unavailable or available only through the SoC API (see relevant SDS documentation).”

I have tried using the RNG drivers that come with the nRF SDK but that doesn’t help. 

  1. What is this “SoC API” that is referenced if not the SDK API?
  2. Why is this happening? What does the BLE system do that can cause another peripheral to go away?
Parents
  • I have some notes I made which might help regarding restricted and unavailable peripherals, including the RNG, though I don't offhand know the availability of sd call functions when these restrictions are in place without a search through the sd functions

    // 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 enabled

    Maybe look at something like nrf_crypto_rng_init() in nrf_crypto_rng.c tosee if that makes clear the restrictions

Reply
  • I have some notes I made which might help regarding restricted and unavailable peripherals, including the RNG, though I don't offhand know the availability of sd call functions when these restrictions are in place without a search through the sd functions

    // 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 enabled

    Maybe look at something like nrf_crypto_rng_init() in nrf_crypto_rng.c tosee if that makes clear the restrictions

Children
No Data
Related