External SDRAM problem

*DH11 instead of DHT22; Audio out is connected to a 12v sound amp and then to a speaker

** brown wire is an electrode connected to A1 via 1mOhm, electrodes give me numbers from 1000 to ~22000

Hello. I’m building a granular synth based on data from DH11 and electrodes connected to A1&GND. When I make a sound based on a sinewave everything works fine. Sketch1

sketch1.txt (4.0 KB)

I want to use the same principle with .wav. I’ve made this setup with Waveshare microSD module, daisy can read the file and synth worked somehow, but I need much longer grains. So ones again I’ve tried to use External SDRAM and ones again I broke my head but I can’t do it no matter how many time I spent trying to figure it out with AIs. My sketch2 uploads fine, but oled shows ‘Initializing…’ and it hangs.
I’m super new to coding and will really appreciate any help on solving this. Previously I’ve tried the same but to load the whole .wav to External SDRAM and also couldn’t do it. What I’m doing wrong?

sketch2.txt (5.8 KB)

One more small question, when I upload via ArduinoIDE setup starts working right after upload, but when I upload from Visual Studio Code nothing works until I open serial monitor, can you please advice why?

THANK YOU

Welcome @Ivan! Great to have you join us :slight_smile:

Please feel free to share the code in your post itself. You can use the edit feature, paste in the code, and format it as C++ code. It’ll be quicker for folks here to have a look without needing to download.

It might be good to scale down your code so that it’s a bit easier to troubleshoot. It seems that there are several factors in your code to consider at the moment.

quick guesses:

For the SDRAM, you need to manually clear it all to zeros, otherwise you’ll get NaN’s that will hang it.

For the USB, if you’re setting it up as a Serial device, then it will block until the PC reads it. For Arduino (don’t know for sure), maybe it starts reading it right away.

hello, thank you. How can I format it as C++ code?

The StartLog method has an optional argument:

static void daisy::DaisySeed::StartLog(bool wait_for_pc = false )

So, with no argument , or with ‘false’, it won’t wait for the USB.

With ‘true’ argument, it will wait for the connection.

This is very useful for text debugging of code which runs at startup before entering the main loop.