Nobody in this thread, ST staff included, pointed out the one fact that blocks this design, so I found it myself on the hardware. Here is the working solution, so that the next engineer doesn’t lose weeks the way I did.
Result
14-bit continuous capture from a parallel ADC, verified at 48 and 60 MHz; it now runs at 50 MHz.
32 MB written to SDRAM with 0 lost samples (self-test with counter patterns, 640 pattern captures OK).
No CPU in the data path.
The key fact: MDMA has NO DCMI request
The value 75 is DMA_REQUEST_DCMI for the DMAMUX (DMA1/DMA2). It is not an MDMA request. Putting 75 into the MDMA request field (as I did in my code above) means the MDMA never starts. The chain that works is:
DCMI DR --DMA2 Stream1 (double-buffer, DMAMUX req 75)--> 2 x 32 KB in AXI SRAM DMA2 Stream1 TC flag --MDMA hardware request--> MDMA Channel0 MDMA linked list (1024 nodes x 32 KB): source alternates buf0/buf1, destination walks through SDRAM
The rules that make it work
DCMI in hardware sync mode, not embedded sync. Embedded sync needs sync codes inside the data, and an ADC never sends them. Hold HSYNC at the level DCMI treats as valid data (not blanking). Capture starts on one VSYNC edge. In my setup that edge comes from a timer one-pulse, so all boards start together.
DMA2 Stream1 in double-buffer mode (DBM), not circular. Circular mode gives a TC only once per whole buffer, and half-transfer has no MDMA request. DBM gives a TC at the end of each buffer.
The DMA stream TC interrupt must stay disabled. If an ISR clears TCIF (HAL_DCMI_Start_DMA installs one), the MDMA request disappears. Configure the stream by registers, with no TCIE or HTIE.
The MDMA clears TCIF itself through the post-request mask (address DMA2->LIFCR, data DMA_LIFCR_CTCIF1), on the channel and in every node. Otherwise the request stays high and the MDMA runs through all nodes at once.
Stop order: MDMA abort first, then DCMI, then DMA. Disabling the DMA stream sets TC, which would trigger one more MDMA block.
Pixel clock edge. With my ADC the data was clean on the falling PIXCLK edge (PCKPOL = 0); the rising edge gave spikes. Check against your ADC’s output timing.
Buffers and nodes are in AXI SRAM (.RAM_D1, 32-byte aligned). Clean the D-cache over the nodes before starting, because the MDMA reads them from RAM.
/* MDMA triggered by the DMA stream's TC flag */ hmdma.Init.Request = MDMA_REQUEST_DMA2_Stream1_TC; hmdma.Init.TransferTriggerMode = MDMA_BLOCK_TRANSFER; /* 1 request = 1 node */ HAL_MDMA_ConfigPostRequestMask(&hmdma, (uint32_t)&DMA2->LIFCR, DMA_LIFCR_CTCIF1); /* same PostRequestMaskAddress/Data in every linked node */
After I posted my code with 75 in the MDMA request (the exact bug, in plain sight), nobody answered at all. One sentence from someone who knows the H7 would have saved me weeks.
Now that the technical solution is out there, I want to address the elephant in the room regarding the current state of this forum and ST's technical support.
When I opened this topic, I was looking for expert guidance on high-speed hardware orchestration. Instead, all I got was generic, copy-pasted advice from reference manuals that I had already read, followed by absolute silence when things didn't work. No one was capable of pointing out the missing HAL definitions or the exact hardware limitations.
It makes me profoundly nostalgic for the days when Clive1 was active here. He was the ultimate STM32 guru, the most brilliant and skilled engineer. Clive1 didn't just point to an application note; he gave real, working, zero-cost code solutions to the most complex and bizarre problems, helping thousands of developers out of pure passion and sheer competence.
Today, ST engineers seem to have "no time" for real users. ST, bring back the technical excellence that Clive1once gave to this community for free.
Concrete request to ST: document in RM0433 or AN4861 that MDMA has no DCMI request and that a DCMI → DMA → MDMA chain needs the TC flag left for the MDMA, and publish one working DCMI → MDMA → SDRAM example. That is all it would take.
The same firmware runs on three STM32H743 boards. Each board has its own 12-bit ADC (AD9226) and its own 32 MB SDRAM.
Record per channel: 16,777,216 samples at 50 MHz = 335.5 ms.
Synchronised start: one shared VSYNC line. The master board drives it from a timer in one-pulse mode, started in hardware by external trigger, with a programmable delay (verified exact: 1 µs and 1200.25 µs). Every board is armed (DCMI + DMA + MDMA waiting) and starts on the same VSYNC edge. No false starts.
Channel-to-channel timing (A–B, 500 kHz test square wave):
start offset 2–4 ns;
jitter 1.4 ns rms (an upper limit, mostly the interpolation error of the measurement);
0 outliers.
Clock drift: each board makes its own 50 MHz from its own crystal, so the boards drift relative to each other by −2.42 ppm. That is 41 samples (0.81 µs) at the end of the 335 ms record. The drift is measured and corrected in software.
Data integrity:
0 lost samples on every channel (self-test);
640 pattern captures OK;
32 MB USB download CRC OK;
noise with the input shorted 1.1–2.1 counts rms, 0 spikes.
Download: USB CDC from all three boards in parallel to a Raspberry Pi CM5 through a USB hub: 3 × 32 MB in 37.5 s.
Best regards, Nedelcu Bogdan Sebastian
Every day brings a fresh chance to learn something new
To be sure that I ask the right questions and not wasting your time, I will point exactly what is my plan
for the ongoing project.
My current approach:
DCMI configured in continuous mode, no HSYNC/VSYNC (ADC-like data source)
14-bit parallel data at 48 MHz on D[13:0], with DCMI_PCLK = 48 MHz
MDMA linked-list mode with 255 nodes
Each node transfers 65,535 half-words (131,070 bytes)
Each node destination: incremental SDRAM address
LAR of last node optionally points to the first for circular capture (maybe implement trigger in future)
SDRAM configured and verified working via FMC at +100 MHz x16
Cache cleaned/invalidation handled for MDMA buffers
Please help me with the following questions:
Can DCMI continuous mode capture correctly without HSYNC/VSYNC at 48 MHz if the input clock and data are stable? Any special configuration needed for ADC-style capture (no frame sync)?
Is DCMI → DMAMUX → MDMA request rate sufficient to sustain 48 MHz continuous half-word transfers, or should I enable internal burst mode or FIFO threshold settings? Can I go up to 60 MHz?
Can the MDMA linked list operate in circular mode if the last node’s LAR points back to the first node? Or does the MDMA stop automatically after the last node?
For SDRAM writes via FMC, are there any recommended AXI or MPU memory attributes (e.g., non-cacheable, write-through) to avoid cache incoherency or MDMA stalls?
Is 48 MHz DCMI pixel clock within the practical limit for STM32H743IIT6 when capturing continuously through MDMA to SDRAM? Can I go up to 60 MHz?
Any ST examples or application notes demonstrating DCMI + MDMA → SDRAM (e.g., from internal test projects)?
I already reviewed:
RM0433 (DCMI, DMAMUX, and MDMA sections)
AN5020 (Using DCMI, 6.4.9 DMA configuration for higher resolutions)
But I’d appreciate confirmation or advice from ST experts before diving deeper finalizing the hardware.
Thank you for your support,
Nedelcu Bogdan Sebastian
Every day brings a fresh chance to learn something new
1 Can DCMI capture correctly without HSYNC/VSYNC if input clock and data are stable?
Yes, the STM32H7 DCMI peripheral supportscontinuous capture modewithout HSYNC and VSYNC signals, which is suitable for ADC-like data streams.
Special configuration needed?
Set DCMI_CROP feature disabled (if cropping not needed).
Configure DCMI_CAPTURE_MODE = Continuous.
Disable HSYNC and VSYNC inputs in the DCMI control register.
Use embedded synchronization mode or hardware synchronization with only PCLK.
Ensure DCMI FIFO threshold is configured properly (see next section).
The DCMI will capture data on the rising edge of PCLK and push it into its internal FIFO.
Important:The input data and clock must be stable and synchronized to the MCU clock domain or have proper FIFO buffering to avoid metastability.
2 Is the request rate sufficient for 48 MHz continuous half-word transfers?
At 48 MHz and 16-bit data width, the raw data rate is: 48×106×2 bytes=96 MB/s
The STM32H7 MDMA and FMC interface can sustain high throughput, but real achievable throughput depends on bus arbitration, FMC timing, and MDMA burst settings.
Can you go up to 60 MHz?
60 MHz is at the upper limit of the DCMI peripheral pixel clock according to STM32H7 datasheet.
It is possible but challengingdue to increased bus and memory speed requirements.
You must carefully optimize FMC timings, MDMA burst.
3 Can MDMA linked list operate circularly by pointing last node’s LAR back to first node?
The MDMA linked list does not natively support circular mode.
When the last linked list node finishes, the MDMA transfer stops automatically.
To implement continuous circular buffer behavior, you must:
In MDMA transfer complete interrupt, reconfigure or restart MDMA with the linked list again.
Or dynamically update the linked list pointer in software to restart the chain.
Some users implementsoftware-managed circular buffering by restarting the MDMA linked list in the ISR.
4 Cache and MPU settings to avoid cache incoherency or MDMA stalls:
Configure the SDRAM region as Write-Through or Non-Cacheable in MPU to avoid cache coherency issues.
For large continuous DMA transfers, Non-Cacheable is safer but may reduce CPU access speed.
Ensure AXI bus priorityis set to favor FMC/MDMA transfers to reduce stalls.
5 Yes,48 MHz is within the practical limitfor continuous DCMI capture on STM32H743IIT6.
Going beyond 48 MHz (e.g., 60 MHz) is possible but requires careful tuning and may reduce system stability.
6 ST provides some example projects and application notes that can help:
STM32CubeH7 Firmware Package includes DCMI examples (mostly camera capture).
AN5116: "Using the STM32H7 FMC SDRAM interface" — for SDRAM optimization.
AN4861: "Using the STM32H7 MDMA controller" — explains MDMA linked list and burst modes.
STM32CubeH7 DCMI Capture Example: shows DCMI + DMA to internal SRAM or SDRAM.
ST Community Forums and GitHub: users share projects with DCMI + MDMA + SDRAM.
I did start another approach, because in the documentation states that by not using HSYNC/VSYNC you can not work with 14bit data. At least that is what I understand by now. Maybe someone will teach me something different, please.
I generate DCMI PXCLK using TIM2 at 24MHz ,and chain TIM3 HSYNC 30 kHz, and TIM4 VSYNC 60 Hz.
I will test using this configuration to see if DCMI will loose samples.
On the run I will need your valuable help.
If someone consider useful, here is the timers TIM2 -> TIM3 -> TIM4 chaining function, tested with oscilloscope and working:
Nobody in this thread, ST staff included, pointed out the one fact that blocks this design, so I found it myself on the hardware. Here is the working solution, so that the next engineer doesn’t lose weeks the way I did.
Result
14-bit continuous capture from a parallel ADC, verified at 48 and 60 MHz; it now runs at 50 MHz.
32 MB written to SDRAM with 0 lost samples (self-test with counter patterns, 640 pattern captures OK).
No CPU in the data path.
The key fact: MDMA has NO DCMI request
The value 75 is DMA_REQUEST_DCMI for the DMAMUX (DMA1/DMA2). It is not an MDMA request. Putting 75 into the MDMA request field (as I did in my code above) means the MDMA never starts. The chain that works is:
DCMI DR --DMA2 Stream1 (double-buffer, DMAMUX req 75)--> 2 x 32 KB in AXI SRAM DMA2 Stream1 TC flag --MDMA hardware request--> MDMA Channel0 MDMA linked list (1024 nodes x 32 KB): source alternates buf0/buf1, destination walks through SDRAM
The rules that make it work
DCMI in hardware sync mode, not embedded sync. Embedded sync needs sync codes inside the data, and an ADC never sends them. Hold HSYNC at the level DCMI treats as valid data (not blanking). Capture starts on one VSYNC edge. In my setup that edge comes from a timer one-pulse, so all boards start together.
DMA2 Stream1 in double-buffer mode (DBM), not circular. Circular mode gives a TC only once per whole buffer, and half-transfer has no MDMA request. DBM gives a TC at the end of each buffer.
The DMA stream TC interrupt must stay disabled. If an ISR clears TCIF (HAL_DCMI_Start_DMA installs one), the MDMA request disappears. Configure the stream by registers, with no TCIE or HTIE.
The MDMA clears TCIF itself through the post-request mask (address DMA2->LIFCR, data DMA_LIFCR_CTCIF1), on the channel and in every node. Otherwise the request stays high and the MDMA runs through all nodes at once.
Stop order: MDMA abort first, then DCMI, then DMA. Disabling the DMA stream sets TC, which would trigger one more MDMA block.
Pixel clock edge. With my ADC the data was clean on the falling PIXCLK edge (PCKPOL = 0); the rising edge gave spikes. Check against your ADC’s output timing.
Buffers and nodes are in AXI SRAM (.RAM_D1, 32-byte aligned). Clean the D-cache over the nodes before starting, because the MDMA reads them from RAM.
/* MDMA triggered by the DMA stream's TC flag */ hmdma.Init.Request = MDMA_REQUEST_DMA2_Stream1_TC; hmdma.Init.TransferTriggerMode = MDMA_BLOCK_TRANSFER; /* 1 request = 1 node */ HAL_MDMA_ConfigPostRequestMask(&hmdma, (uint32_t)&DMA2->LIFCR, DMA_LIFCR_CTCIF1); /* same PostRequestMaskAddress/Data in every linked node */
After I posted my code with 75 in the MDMA request (the exact bug, in plain sight), nobody answered at all. One sentence from someone who knows the H7 would have saved me weeks.
Now that the technical solution is out there, I want to address the elephant in the room regarding the current state of this forum and ST's technical support.
When I opened this topic, I was looking for expert guidance on high-speed hardware orchestration. Instead, all I got was generic, copy-pasted advice from reference manuals that I had already read, followed by absolute silence when things didn't work. No one was capable of pointing out the missing HAL definitions or the exact hardware limitations.
It makes me profoundly nostalgic for the days when Clive1 was active here. He was the ultimate STM32 guru, the most brilliant and skilled engineer. Clive1 didn't just point to an application note; he gave real, working, zero-cost code solutions to the most complex and bizarre problems, helping thousands of developers out of pure passion and sheer competence.
Today, ST engineers seem to have "no time" for real users. ST, bring back the technical excellence that Clive1once gave to this community for free.
Concrete request to ST: document in RM0433 or AN4861 that MDMA has no DCMI request and that a DCMI → DMA → MDMA chain needs the TC flag left for the MDMA, and publish one working DCMI → MDMA → SDRAM example. That is all it would take.
The same firmware runs on three STM32H743 boards. Each board has its own 12-bit ADC (AD9226) and its own 32 MB SDRAM.
Record per channel: 16,777,216 samples at 50 MHz = 335.5 ms.
Synchronised start: one shared VSYNC line. The master board drives it from a timer in one-pulse mode, started in hardware by external trigger, with a programmable delay (verified exact: 1 µs and 1200.25 µs). Every board is armed (DCMI + DMA + MDMA waiting) and starts on the same VSYNC edge. No false starts.
Channel-to-channel timing (A–B, 500 kHz test square wave):
start offset 2–4 ns;
jitter 1.4 ns rms (an upper limit, mostly the interpolation error of the measurement);
0 outliers.
Clock drift: each board makes its own 50 MHz from its own crystal, so the boards drift relative to each other by −2.42 ppm. That is 41 samples (0.81 µs) at the end of the 335 ms record. The drift is measured and corrected in software.
Data integrity:
0 lost samples on every channel (self-test);
640 pattern captures OK;
32 MB USB download CRC OK;
noise with the input shorted 1.1–2.1 counts rms, 0 spikes.
Download: USB CDC from all three boards in parallel to a Raspberry Pi CM5 through a USB hub: 3 × 32 MB in 37.5 s.
Best regards, Nedelcu Bogdan Sebastian
Every day brings a fresh chance to learn something new