I have a reverb app that I used for my students last year without issue. I hope to use it again in lab soon. I can still run it in Native mode, but now when I try to run on my STM Discovery board, I get the error "failed, heap allocation request too large." The number quoted in the error is the value set in my delay block. The same error occurs when I set delays to zero. I have attached "reverb.awd" below. Thanks for your advice!
Screenshots attached:
Error when delay is 2689.
Error when delay is 0.
4:46pm
Hello,
The memory footprint of the delay module is determined by the maxDelay variable, not the currentDelay. Try decreasing the maxDelay size to use less of the available memory on the target.
-Axel
4:50pm
By the way, you can estimate how much memory is needed by an .awd by running it with the Native target and looking at the consumed heap in the AWE Server. With your .awd I see 885 32-bit words used in the Fast Heap, and 20079 32-bit words used in the Slow Heap. This will mostly match the required heap on your target, minus some potential differences in stuff like sizeof(void*) between your target and your PC.
2:32pm
Dropping Max Delay worked great. Thank you! I appreciated your reference to those heap sizes, because I can get to bigger delays by putting my Delay blocks into Fast Heap B, which is the largest.
Do I have control over the sizes of the various Heaps?
4:09pm
Hello, glad to hear that dropping maxDelay worked for you!
As for controlling the heap sizes, yes you are able to change them. To do this, you will need to modify the TargetInfo.h file (which contains #defines that define the heap sizes) and then rebuild/reflash the BSP. Try increasing the heap sizes until you run out of memory.
The memory is limited on these discovery boards, so it may also be worth it for you to prune down your ModuleList.h. You can remove any modules that you don't plan on using to free up some memory for your heaps. To do this, simply delete the modules that you don't need from the LISTOFCLASSOBJECTS.
Let us know if you need any help with this!
-Andrew P
PS: Its very exciting that you are using AWE in the classroom :]
7:18pm
I found both of those files, and I see I would recompile a new SW4STM32.bin file to put the changes into effect. I admit I am not clear on what "slow heap" or "fast heap" portend. I haven't yet found any remarks about these at STMicro. But for my current purposes I don't badly need to know more.
We too are very excited about using AWE! In the past we used TI boards but the software was so unwieldy for simple tasks. My students love Audio Weaver with the STMicro boards, and I love that they can think more about DSP operations than C code while they learn. I also very much appreciate the excellent support I've been receiving in this forum whenever I run into a roadblock. Kudos to all of your team!
10:16am
Hello again,
The reason you can't find anything from ST is because the heaps are actually an AudioWeaver thing, not an ST Micro thing! Basically, they are just pre-allocated blocks of memory that we use internally in the AWECore. Less time critical data is stored in the slow heap, as opposed to the two fast heaps.
We are so glad to hear that AWE is so popular amongst the students in the classroom. Enabling people to experiment and learn DSP without being a C guru really is a game changer! We are also always happy to provide support, and we really appreciate the kind words. Thanks again, and do not hesitate to let us know if you need anything else.
-Andrew and the DSPC Team