cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 – DAC with DMA – more memory needed to store DAC tones

TMA1of3
Associate III

hello ST,

my question is about the use of DAC with DMA on the STM32H743. I need to be able to store more tunes/tones into memory.

The working code is based on an ST sample code, DAC_Ch1_EscalatorConfig(), albeit with many more samples used:

HAL_DAC_Start_DMA(&DacHandle, DAC_CHANNEL_1, (uint32_t *)dingdong_samples, dingdong_samples_num, DAC_ALIGN_8B_R)

In this case dingdong_samples_num is 250,068 bytes.

I believe the associated ‘dingdong_samples’ are stored in the ‘data’ area of AXISRAM, and the compiler is showing 357.6kB of 512kB used in this data space with the total amount of AXISRAM then near the limit at 503.5kB.

With the ‘dingdong’ tune commented-out this data space usage in AXISRAM reduces to 113.4kB of 512kB - so 244.2kB less, and I would’ve expected 250.068kB less ? The usage of other sections of AXISRAM remain the same.

I need to fit more tones/tunes into memory, and was wondering how this could be achieved ? For example can another memory space, instead of AXISRAM, be used and if so how ? Are there any other options apart from shortening the number of tone data bytes, please ?

5 REPLIES 5
MHank.1
Associate III

I'm currently working with DMA and off chip SPI memory so I'll put my 2 sense in.

Why not use Flash or EEPROM to store your sounds and load them into SRAM using DMA. You could store as many as you have external memory and just load them in as needed.

TMA1of3
Associate III

Unfortunately the hardware is fixed as is, and can't be changed for this purpose.

Really need a solution using existing memory inside the micro (if there is such an option).

But, thank-you.

MHank.1
Associate III

About the only other answer would be some form of compression, not sure how much that would help. I'm not familiar with compression algorithms.

AScha.3
Chief

from the name  ‘dingdong’ sound I conclude : its not about a musical hi-fi sound, but more like system sounds (mouse click, info message...etc).

so do it, like its done in music synths : the wave is calculated live from som info about spectral content, waveform and envelope. needs not much place to store.

or for very complex and realistic sounds a small sample (maybe 10ms) is stored and repeated in loop, just the envelope (volume) is calculated live; this needs more storage, maybe 8kB for a sound.

but much easier , than storing the full, long sound.

If you feel a post has answered your question, please click "Accept as Solution".
TMA1of3
Associate III

'dingdong' was a test file used to prove the concept of dac/dma functionality, but it will need to be replaced with multiple smaller files hence the original question about the possibility of using other micro memories to store the bytes. Of course it would be nice to minimize the amount of looping and to maximise the sound quality all of which needs more memory. But, thank-you for your suggestions.

If anyone from ST has information in relation to that question please let me know, thanks.