FelipeMdeO opened a new pull request, #20229:
URL: https://github.com/apache/nuttx/pull/20229

   ## Summary
   
   The FIFO watermark flag is a level: it stays high until the worker
   actually drains the FIFO below the threshold. Configuring INT1 as
   `RISING` (`boards/xtensa/esp32s3/common/src/esp32s3_board_lsm6ds3trc.c`)
   made that a race the driver could lose permanently.
   
   `lsm6ds3trc_interrupt()` disables its IRQ on entry and re-enables it after
   the worker has run. With an edge trigger, if the line is still high when
   the IRQ is re-enabled — precisely what happens whenever a drain doesn't
   take the FIFO below the watermark — there is no new low-to-high transition
   left to detect, and the line goes mute forever. Observed as a board that
   serviced exactly one watermark after boot and then never again,
   reproducible 2 out of 2 reflashes.
   
   Fix: `ONHIGH` instead of `RISING`. This matches the physical meaning of
   the pin and is immune to the race: a level trigger re-asserts on its own
   for as long as the condition holds, and the existing disable/enable
   pairing around servicing is what stops that from live-locking.
   
   ## Impact
   
   * Is new feature added? No — pure bug fix.
   * Is existing feature changed? No — corrects a trigger-mode
     misconfiguration; the driver's own disable/enable protocol is unchanged.
   * Impact on hardware? 
`boards/xtensa/esp32s3/common/src/esp32s3_board_lsm6ds3trc.c`
     is shared board bring-up code — affects every esp32s3 board using this
     helper, not just the XIAO.
   
   ## Testing
   
   I confirm that changes are verified on local setup and works as intended:
   
   * Build Host: Ubuntu 24.04, x86_64, `xtensa-esp-elf-gcc`.
   * Target: Xtensa, Seeed XIAO ESP32-S3 (esp32s3-xiao).
   
   Before the fix: reproducible 2/2 reflashes — one watermark serviced after
   boot, then permanently silent. After the fix, validated with more than 900
   consecutive drains (~100 min) including real sleep → GPIO-wake → resume
   transitions, the exact case that used to wedge it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to