cancel
Showing results for 
Search instead for 
Did you mean: 

SRAM scattered architecture on the STM32H7

raghu tumati
Associate II

Hello

For the STM32H7 micro controllers what does a "SRAM with scattered architecture mean".

"The STM32H7x3 line provides from 1 to 2 Mbytes of Flash memory, 1 Mbyte of SRAM with a scattered architecture: 192 Kbytes of TCM RAM (including 64 Kbytes of ITCM RAM and 128 Kbytes of DTCM RAM for time-critical routines and data), 512 Kbytes, 288 Kbytes and 64 Kbytes of user SRAM, and 4 Kbytes of SRAM in backup domain"

I would like to design a camera board which outputs a RGB565 640x480 image. This comes to be 614.4Kbytes. I would like to store this into the SRAM using a DMA transfer. I do not want to use an external SDRAM if not needed.

So just wondering whether I could allocate a frame buffer in the SRAM for the H7 device to store the entire 640x480 image. The scattered architecture confuses me because I am not sure if I could allocate a contiguous array of size 614.4 KBytes

I would appreciate any feedback

Thanks

4 REPLIES 4

The data sheet and/or reference manual should show the memory map, and what's where, and what is overlapped/shadowed.

Pretty sure there isn't 615 KB accessible in one linear block.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
raghu tumati
Associate II

Thanks Clive!

Danish1
Lead II

Although it is easier to understand / process / debug with the entire frame in one contiguous block in RAM, I don't think it is strictly necessary even if you want to load it all by DMA.

The STM32H7 DMA controller can only transfer blocks of up to 64k bytes at a time. But you can use it in "Double Buffer" mode where it uses one set of source, destination and count registers and gives you an interrupt to allow you to update the other set. So you can "chain" several blocks of up-to 64 k bytes for a single DMA transfer, and they do not need to be contiguous in RAM.

There's also the MDMA controller, which I haven't got my head around yet, that seems to offer a "Linked-list" mode that automagically loads up new addresses etc from a table that you provide.

But on the other hand, if you want to do any processing on the image (other than brightness / contrast / color) then it is hard for the processing to be in-place; you are likely to want separate input and output buffers. So I'd want several frames worth of RAM.

Hope this helps,

Danish

raghu tumati
Associate II

Hi Danish

Thanks for the detailed reply. I thought the DMA would always needs a contiguous block. Thanks for clearing that up.

My objective is to actually perform jpeg compression on the raw image. my jpeg compression is taking ~50ms right now for a 320x240 image (I still need to optimize it).

If the raw image is stored in non contiguous blocks, wouldn't it be still possible to perform a jpeg compression albeit a bit more complicated algorithm from what I have.

Store a complete frame -> perform jpeg compression -> acquire another frame -> repeat

I would get a very slow frame rate, but still possible right?

Or is the only good option here is to use an external SDRAM. Would love to hear your thoughts on this.