Skip to content

fix jpeg soi check for psram_mode (DMA) #776

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RubenKelevra
Copy link
Contributor

@RubenKelevra RubenKelevra commented Jul 21, 2025

Description

  • Added a configurable probe length for PSRAM JPEG validation via CAM_SOI_PROBE_BYTES
  • For PSRAM mode, CAM_SOI_PROBE_BYTES is copied from the first DMA block into a stack buffer and validated by cam_verify_jpeg_soi() to verify that it's a valid jpeg image before continuing the capture.
  • Reading from PSRAM directly with cam_verify_jpeg_soi() is here avoided due to latency of small operations done by cam_verify_jpeg_soi().

Related

Related #775

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.

@RubenKelevra RubenKelevra force-pushed the bugfix/implement_jpeg_soi_check_for_psram_dma branch from 1d950f1 to c45e7d8 Compare July 21, 2025 15:11
@RubenKelevra RubenKelevra marked this pull request as draft July 21, 2025 15:19
@RubenKelevra RubenKelevra force-pushed the bugfix/implement_jpeg_soi_check_for_psram_dma branch 6 times, most recently from ab36a5d to cac4990 Compare July 21, 2025 20:42
- Added a configurable probe length for PSRAM JPEG validation via CAM_SOI_PROBE_BYTES
- For PSRAM mode, CAM_SOI_PROBE_BYTES is copied from the first DMA block into a
  stack buffer and validated by cam_verify_jpeg_soi() to verify that it's a valid
  jpeg image before continuing the capture.
- Reading from PSRAM directly with cam_verify_jpeg_soi() is here avoided due to
  latency of small operations done by cam_verify_jpeg_soi().
@RubenKelevra RubenKelevra force-pushed the bugfix/implement_jpeg_soi_check_for_psram_dma branch from cac4990 to 1c0f7bd Compare July 21, 2025 20:56
@RubenKelevra RubenKelevra marked this pull request as ready for review July 21, 2025 21:00
@me-no-dev
Copy link
Member

have you tested this? If so, at what XCLK and what is the success rate?

@RubenKelevra
Copy link
Contributor Author

have you tested this? If so, at what XCLK and what is the success rate?

I can't yet test this. The SOI check should now work, but the end of image byte check needs the same treatment.

Once I've done this I will check this with the m5 thingy I got here, with the 16 MHz you suggested, which previously would just fail with "no SOI"

@RubenKelevra
Copy link
Contributor Author

RubenKelevra commented Jul 22, 2025

I've just sent the PR for the EOI fix. Will test both ASAP.

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.

2 participants