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.
Allocation of Dynamic Memory
Re: Allocation of Dynamic Memory
Are you sure it's a stack overflow? You can try increasing the task stack size, or share the code here if you think it shouldn't be happening.
Check those allocs. If you want enough memory for 4096 floats, you'll need 4096 * sizeof(float).
Check those allocs. If you want enough memory for 4096 floats, you'll need 4096 * sizeof(float).
-
- Posts: 3
- Joined: Thu Jul 30, 2020 2:32 pm
Re: Allocation of Dynamic Memory
I have attached the code for your reference.
- Attachments
-
- MMD_Lite_tested.txt
- (3.9 KiB) Downloaded 363 times
-
- Posts: 3
- Joined: Thu Jul 30, 2020 2:32 pm
Re: Allocation of Dynamic Memory
May I kindly know if anyone can help on this ?
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: Allocation of Dynamic Memory
Pretty sure boarchuz already gave some good starting points; did these not work out for you?
Who is online
Users browsing this forum: Bing [Bot] and 86 guests