Using the external memory in efficient way

Hi!
I’m fairly new with the embedded realm, and I want to learn how to use the SDRAM in the efficient way.
In the examples I see that in order to place some data to external mem one should declare it like float DSY_SDRAM_BSS somedelayline[123].

To my understanding I must use some special way to write and read from this data.
I know about existence of the DMA, and see some configurations for it in the lib daisy, but I can not find examples how to use it within Daisy ecosystem.

Can someone provide such example please?

DSY_SDRAM_BSS is what allocates your variable in memory section used for SDRAM. This would create an empty buffer and whatever you write to it will be stored on SDRAM.

You don’t have to use DMA to write to SDRAM. You might do that in some uncommon cases - when you design an algorithm that can prefetch data from external RAM, while other data is being computed. If you actually need to use something like that, you should read reference manual for this MCU and see example code by STM.

The biggest problem is that Google may not find exactly what you expect if you search something like “how to use MDMA” :partying_face: :pill::drooling_face:

3 Likes

Could there be some performance issues with direct SDRAM memory manipulation, for example, having many delay lines in some reverb topology (thus constant read/write)? I’ve already did some experiments with several delay lines, but further ones will require more.

Definitely, you can bottleneck the MCU by just using lots of delay lines on SDRAM, also this is very informative post about solving the same problem.

But you should start measuring MCU utilization before discussing performance issues, otherwise you may be optimizing prematurely. Also, H7 is a fairly complex MCU, there are other memory regions besides SRAM/SDRAM that can be used with lower latency.

3 Likes

What you’re using to measure resource utilization? Both memory and computing.
For the computing part, it is tricky, because it seems that one should keep the track of “useful” operations.

I’m not using libDaisy, I’ve made OWL port to Daisy Patch. But measuring CPU usage is actually pretty simlpe. As for memory, OWL runs RTOS that handles dynamic memory allocation and it is also used to get amount of used memory.

1 Like