AE3 trigger mode problem

After delete omv_gpio_write(csi->fsync_pin, 1);

and build, flash firmware. with csi0.ioctl(csi.IOCTL_SET_TRIGGERED_MODE, True) (running scripts/examples/01-Camera/04-Global-Shutter/triggered_mode.py) and I can still see image in openmv IDE. Without trigger, snapshot() should throw a timeout? Thank you very much

EDIT: I found csi0.ioctl(csi.IOCTL_SET_TRIGGERED_MODE, True) should move to right after csi0.reset()

Still need anything? Also, for the triggered output, the PR for that is here: drivers/sensors: Add PAG7936 strobe mode support. by kwagyeman · Pull Request #3237 · openmv/openmv · GitHub

Once merged, all the stuff you want should be exposed.

Hi @kwagyeman I think there is a bug in current triggered_mode.py example (openmv/scripts/examples/01-Camera/04-Global-Shutter/triggered_mode.py at master · openmv/openmv · GitHub), causing trigger mode not working properly.

Proof:
Do not toggle FSYNC in omv_csi.c, remove the omv_gpio_write(csi->fsync_pin, 1) in openmv/common/omv_csi.c at 631681e5ac5ab332c920b6bf9cd3dba5cf299eac · openmv/openmv · GitHub. If trgger mode is working properly, snapshot() should timeout due to sesnor not triggered. Instead, openmv IDE still be able to show camera frame buffer image as usual.

Fix:
move csi0.ioctl(csi.IOCTL_SET_TRIGGERED_MODE, True) above, right after csi0.reset().

Great find, and thanks for the clean repro method – you were right, and it’s a
driver bug, not the example. The PAG7936’s suspend command only takes effect at
the next frame boundary, and the trigger configuration written right after it
is ignored unless the sensor has actually suspended (the datasheet requires a
one-frame delay there, which the driver skipped). That’s also why the position
of the ioctl mattered: before framesize() nothing is streaming, so the
sequence latches; after, the sensor is mid-frame and ignores it. It’s frame
size dependent too – at QVGA the short frames happen to end inside the I2C
write sequence, so it accidentally works there, while VGA/HD never engage.

Fixed by waiting out the in-flight frame after suspend:
drivers/sensors: Fix PAG7936 triggered mode enable on a running sensor. by kwagyeman · Pull Request #3263 · openmv/openmv · GitHub. Verified on an AE3 with your exact test (FSYNC pulses removed
from the firmware): after the fix, snapshot() times out at every frame size
once triggered mode is enabled – including with the example’s original
ordering – and with FSYNC restored the triggered_mode.py example works
unmodified.

Hi @kwagyeman Thank you so much for investigation and fix. I will test it.

Hi @kwagyeman this fix works on AE3 with QVGA, VGA and HD resoulution, Thank you very much.