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

sys_rand32_get() crashes the application

I updated the nRF Connect SDK to latest master. It currently uses Zephyr 7d20f2ebf2. Most of the time (~4 times out of 5), calling sys_rand32_get() crashes the firmware and the nRF9160 reboots.

As a temporary workaround, I enabled CONFIG_XOROSHIRO_RANDOM_GENERATOR.

Parents
  • This one is insidious.    It's used extensively in MQTT examples, especially in the AWS MQTT/FOTA examples, also it appears a number of times in other drivers.  In my case, CONFIG_XOROSHIRO_RANDOM_GENERATOR was the better solution than changing everything.   Symptoms for me were fairly random HardFaults and Hangs.  Sometimes immediately, sometimes after running for a few minutes  (showed up immediately when I increased the sending rate to 1 mqtt publish per second).

Reply
  • This one is insidious.    It's used extensively in MQTT examples, especially in the AWS MQTT/FOTA examples, also it appears a number of times in other drivers.  In my case, CONFIG_XOROSHIRO_RANDOM_GENERATOR was the better solution than changing everything.   Symptoms for me were fairly random HardFaults and Hangs.  Sometimes immediately, sometimes after running for a few minutes  (showed up immediately when I increased the sending rate to 1 mqtt publish per second).

Children
No Data
Related