Environment
Hardware: Thingy:91 X (nRF9151)
SDK: nRF Connect SDK v2.8.0
Zephyr: v4.2.99
Driver: ADXL367 with interrupt-based activity detection
Configuration: CONFIG_ADXL367_TRIGGER_GLOBAL_THREAD=y
Problem Description
Motion detection triggers successfully once after reboot, but then stops working completely. Subsequent motion events are not detected until the device is power cycled.
Expected behavior: Continuous motion detection with callbacks on each motion event
Actual behavior: First motion event works, then silence forever
Current Configuration
// Activity detection settings
CONFIG_ADXL367_ACTIVITY_DETECTION_MODE=y
CONFIG_ADXL367_INACTIVITY_DETECTION_MODE=n
CONFIG_ADXL367_ACTIVITY_THRESHOLD=50 // 50 * 250mg = 12.5g threshold
CONFIG_ADXL367_ACTIVITY_TIME=1 // 1 sample at 100Hz
CONFIG_ADXL367_TRIGGER_GLOBAL_THREAD=y
// Using DEFAULT mode (not LINKED/LOOPED) for activity-only detection
Application Code
static void motion_trigger_handler(const struct device *dev,
const struct sensor_trigger *trigger)
{
LOG_INF("Motion detected! (Activity interrupt)");
// ... callback logic
}
int motion_enable(void)
{
struct sensor_trigger trig = {
.type = SENSOR_TRIG_THRESHOLD,
.chan = SENSOR_CHAN_ACCEL_XYZ,
};
}
Debugging Done
Verified interrupt re-enable logic: Modified adxl367_trigger.c to ensure GPIO interrupt is always re-enabled even on STATUS register read failures
Checked processing mode: Using ADXL367_DEFAULT mode (not LINKED) since inactivity detection is disabled
Verified GPIO configuration: INT1 pin configured correctly, first interrupt fires successfully
Added logging: Confirmed STATUS register reads complete and handlers are called
Observations
First motion event: Interrupt fires, handler called, logs appear
Second motion event onwards: No interrupt, no handler, complete silence
After power cycle: First motion works again, then stops
Questions
Does the ADXL367 require special acknowledgment of activity interrupts beyond reading the STATUS register?
Should activity detection be configured differently for continuous triggering?
Are there any undocumented register settings needed for the interrupt to re-arm automatically?
Could this be related to the activity timer (ADXL367_TIME_ACT) with a value of 1 sample?
Request
Has anyone successfully implemented continuous motion detection with the ADXL367 on Zephyr? Any insights into what might cause the interrupt to stop firing after the first trigger would be greatly appreciated.