use 5 ticks as MINIMUM_COMPAREVALE_ADVANCE (refer to user guide cc2538 section 13.2)
// ========================== define ==========================================
#define TIMERLOOP_THRESHOLD 0xffffff // 511 seconds @ 32768Hz clock
-#define MINIMUM_COMPAREVALE_ADVANCE 10
+// refer to SWRU319C cc2538 user's guide: section 13.2:
+// -- When setting a new compare value, the value must be at least 5 more than the
+// -- current sleep timer value. Otherwise, the timer compare event may be lost.
+#define MINIMUM_COMPAREVALE_ADVANCE 5
// ========================== variable ========================================
