Closed nashif closed 7 years ago
by Andrew Boie:
Anas Nashif found this bug. The initial fix I make simply added another allowable tick of slop, but looking at this more carefully it doesn't make any sense that more than one tick should elapse in this test. Investigating further.
by Andrew Boie:
I've found the problem. The test case assumes that when it puts the CPU to sleep with k_cpu_idle(), the interrupt that wakes up the device will be a timer interrupt and hence we would have advanced to the next tick.
But instead what is happening is that we are getting an interrupt from the nrf5_power_clock driver, which causes k_cpu_idle() to return far earlier than expected and the tick has not advanced, failing the test. The power clock interrupt seems to be something that happens in the first 20 milliseconds of device uptime; I found that I can get it to pass by moving the idle test to near the end of the test suite.
by Andrew Boie:
Reported by Andrew Boie:
(Imported from Jira ZEP-2257)