Skip to content

cam_hal: psram: reset DMA and yield after NO-EOI to resume capture #783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

RubenKelevra
Copy link
Contributor

@RubenKelevra RubenKelevra commented Aug 4, 2025

Description

In PSRAM JPEG mode, a truncated frame (missing EOI) could leave GDMA in
a bad state and cause subsequent captures to time out.

Fix:

  • On the NO-EOI path, reset the DMA channel (ll_cam_dma_reset(cam_obj)).
  • Yield once (vTaskDelay(1)) to let the pipeline restart cleanly.

Result: the driver recovers on the next frame instead of timing out,
reducing spurious capture failures after truncated JPEGs.

Testing

Does fix some crashes, but not everything in psram_mode with JPEGs.


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

In PSRAM JPEG mode, a truncated frame (missing EOI) could leave GDMA in
a bad state and cause subsequent captures to time out.

Fix:
- On the NO-EOI path, reset the DMA channel (`ll_cam_dma_reset(cam_obj)`).
- Yield once (`vTaskDelay(1)`) to let the pipeline restart cleanly.

Result: the driver recovers on the next frame instead of timing out,
reducing spurious capture failures after truncated JPEGs.
@RubenKelevra RubenKelevra force-pushed the fix/timeouts_after_truncated_frames_in_psram_mode branch from 98ba86b to 6a9ce4f Compare August 5, 2025 04:17
@RubenKelevra RubenKelevra marked this pull request as draft August 5, 2025 04:25
@RubenKelevra
Copy link
Contributor Author

This was a hunch and doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant