It appears that after a few seconds and sometimes after a few minutes sleeping threads do not wake up, even though the UART shell and BT NUS are working. The only service that the BT is advertising is the BT NUS. This problem occurs after the first time that I connect to the BT NUS from my Android phone. If I don't connect to the BT NUS, then the firmware does not show this problem. The only way that I've been able to recover the nRF52840 is by resetting it. I don't see this problem in version 1.8.0 of the SDK.