How to get raw data directly from ArduCAM-2MP-Plus on STM32F746G-DISCO without decoding?

Hi everyone, I’m trying to get raw data straight out of my camera without decoding it first. The datasheet says the sensor supports YUV / jpeg / RGB_raw output formats, so I figured there should be a way to just grab the raw frames directly. Does anyone know of an open-source project I could look at that does this? I really want to skip the decode step entirely.

Welcome! A few things that’ll help us point you in the right direction: which camera module are you using exactly, and what board is it running on? Also, what format are you currently pulling from the sensor — jpeg, or one of the raw/YUV modes? The path for raw data is quite different from the jpeg path, so the details matter here.

Sure. It’s an ArduCAM-2MP-Plus, I picked it up last month. I’m running it with an STM32F746G-DISCO board. So far I’ve actually got things working — I can pull the jpeg-decode buffer and it displays fine on the LCD. That part is good. The problem is now I want to bypass the decode step and get the raw data directly. Per the doc it supports YUV/jpeg/RGB_raw, so I’d like to use one of those raw formats and handle the color myself.

Got it, thanks. So you’ve confirmed the jpeg capture + decode + LCD path works on the F746G-DISCO, and now you want the raw capture path instead of going through the JPEG decoder. Can you describe a bit more concretely what you’re trying to end up with? Like, what does your buffer/processing chain look like in your head?

Basically the goal is to create a uint8 buffer of 160x120, feed it into the camera capture pipeline, and then fill in the color info using the buffer I created — so I never have to run the decode. Right now everything goes through the JPEG decode path and I just want to skip that. Is there an example or repo that shows grabbing raw data directly?

That makes sense. The link below may help — it’s the ArduCAM Arduino library and it has the low-level routines for capture modes other than the jpeg/decode path, so you can see how they read out the buffer directly:

Take a look at how the different output formats are selected and how the raw/YUV buffers are handled there, that should be the closest reference to what you’re describing.

Thanks, I’ll dig into that repo. Just to double check — the example I’ve been looking at keeps routing through the decode buffer, so I want to make sure I’m not missing a step when switching to a raw format. Is there anything specific I should watch for when moving from the jpeg path to a raw capture mode?

Mainly just make sure the sensor’s output format register is actually set to the raw/YUV mode you want before capture — if it’s still configured for jpeg you’ll never get raw bytes out no matter what the buffer size is. Also keep in mind the raw modes give you packed data (not decoded RGB), so a 160x120 uint8 buffer will hold sensor-native bytes, and you’ll need to interpret the color layout yourself. The library shows how the readout is structured for those modes.

Got it, that clears up the confusion about the buffer contents. I’ll work through the reference and try switching the format over. Appreciate the pointer.

To sum up where this landed: the requirement is to pull raw data (YUV/jpeg/RGB_raw) directly from the ArduCAM-2MP-Plus on the STM32F746G-DISCO without going through the jpeg decode path. The recommended reference for that is the ArduCAM Arduino library here:

Start by confirming the sensor output format is set to your target raw mode, then follow how the library reads out the raw buffer instead of the decode buffer. If you hit a snag after switching formats, post your capture config and we’ll take another look. — Dion, Arducam Support Team