This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF52840 startup delay

Hi,

We are facing a very long startup delay with nRF52840 and I would know if there are some possibilities to reduce it.

I have made some measurements in different configurations. The delay has been measured by toggling a GPIO at the start of PRE_KERNEL_2 and then at main() entry. See the result below:

  • MCUBoot + ext 32k -> 910ms
  • Ext 32k -> 860ms
  • Int RC -> 545ms

We use the Nordic Softdevice BT controller, 1x SPI and miscellaneous CONFIG within NCS 1.6.1 and up.

Could the proj.conf and/or autoconf.h may help you to define if something can be improved ?

If I make the same test with Blinky and nRF52840dk I got 255ms (ext 32k) and 5ms (int RC) so I would expect around 250ms in our case too (ext 32k).

Best regards,

Romain

Parents Reply Children
  • I did some measurements with an nRF52840 DK using the external 32k without MCUboot, running the BLE peripheral UART sample with the SoftDevice Controller (forgot to enable SPI)

    I saw that the function mpsl_lib_init took 250 ms, which is expected, since it's waiting for the 32 kHz clock to get started (see ticket 116026). I saw that the function hw_cc3xx_init_internal() used 434ms. I will ask internally about the hw_cc3xx function and get back to you.

    I tried to measure at the same places as you, at the start of pre kernel 2 and at the start of start of main, but it only took 54ms. However, the execution time of pre kernel 1 took 685ms (~=250ms + 434ms).

  • It is the function nrf_cc3xx_platform_init() specifically that causes the long startup time.

    You need to initialize the RNG engine in CryptoCell and it takes time.
    The only option is to not use the nrf_cc3xx for the RNG driver and instead use nRF5 HW peripheral. 
    The nRF5 RNG is simpler than the CryptoCell RNG. There are some differences between these, as stated in the nRF5 SDK documentation --> RNG
    • CryptoCell CC310 (default for devices with CC310)
    • nRF HW RNG peripheral:
      • CTR-DRBG mode using mbed TLS (default for devices without CC310)
      • Raw mode

    CC310 is the preferred backend on devices that support it, as it meets the NIST 800-90B3 and AIS-31 (Class “P2 High”) standards. The nRF HW RNG backend is available on all nRF5 devices. Devices that do not include CC310 should normally use the nRF HW RNG with mbed TLS CTR-DRBG. The mbed TLS CTR-DRBG code is standardized by NIST (NIST SP 800-90A Revision 1 ).

  • Hi Simon,

    Indeed this is ~434ms faster when I set CONFIG_ENTROPY_CC3XX=n

    Thank you.

Related