Allocation of Dynamic Memory
Posted: Thu Jul 30, 2020 3:47 pm
We are trying to capture six signals each with 4096 samples and sampling at 500 Hz.
vImag = 0.0;
vReal = (3.3/4095.0)*analogRead(25);
vReal1=(3.3/4095.0)*analogRead(26);
vReal2=(3.3/4095.0)*analogRead(27);
vImag1 = 0.0;
vImag = 0.0;
There was an error "dram segment data does not fit"
So we modified the code by referring to various suggestions provided online by adding pointers and using calloc function.
vReal = (float*)calloc(1,4096);
vImag = (float*)calloc(1,4096);
This time there was no error but when we displayed the result in serial monitor, there was a stack overflow message and there was no output displayed. Please let us know what could be the possible reason and how we could overcome this issue.
vImag = 0.0;
vReal = (3.3/4095.0)*analogRead(25);
vReal1=(3.3/4095.0)*analogRead(26);
vReal2=(3.3/4095.0)*analogRead(27);
vImag1 = 0.0;
vImag = 0.0;
There was an error "dram segment data does not fit"
So we modified the code by referring to various suggestions provided online by adding pointers and using calloc function.
vReal = (float*)calloc(1,4096);
vImag = (float*)calloc(1,4096);
This time there was no error but when we displayed the result in serial monitor, there was a stack overflow message and there was no output displayed. Please let us know what could be the possible reason and how we could overcome this issue.