I’m trying to figure out how to use the SDRAM to create a large buffer (or to hold a large object instance).
I have a simple program that just writes a counter to the OLED and says “hello world” on the USB console once it connects. This is working fine, until…
At the top of my main cpp file, I try to create an object on the SDRAM like this:
#define MAX_DELAY static_cast<size_t>(48000 * 1.f)
CircularBuffer<float, MAX_DELAY> DSY_SDRAM_BSS AudioBuffer;
Once I add that line, the program does compile without error, and it does flash to the Daisy (and the memory during programing shows the SDRAM is now being allocated 0.26%), but as soon as I reset the Daisy, it does nothing. It does not show up as a device for serial monitoring and the OLED is blank.
If I comment out the above line, it shows the “Hello World” on the serial monitor, and the OLED works again.
CircularBuffer is the name of a class that is included. I am not using the CircularBuffer at all. I’m just trying to instantiate it in the SDRAM. I can only guess that the Daisy is immediately crashing on boot.
Relevant parts of the CircularBuffer class:
template <typename T_Type, size_t BufferSize>
class CircularBuffer{
private:
T_Type Buffer[BufferSize];
I’ve looked at libDaisy: Getting Started - External SDRAM and I also tried to use the PluckEcho.cpp and DelayLine.h files as an example. I’m not sure what’s going wrong.