Cooking Hacks Forum
https://www.cooking-hacks.com/forum/

Serial Monitor Stops while sending serial data
https://www.cooking-hacks.com/forum/viewtopic.php?f=59&t=10622
Page 1 of 1

Author:  AsiyaM [ Thu Sep 07, 2017 12:48 pm ]
Post subject:  Serial Monitor Stops while sending serial data

Hello,

I am using MySignals HW v2 to read the ECG data only.
I have almost tried all of the ECG functions and checked the connection of the device to my mobile phone.
At the beginning all things were working fine. However, after increasing the size of the code and adding series of filters, the platform started to freeze or halt when I try to show some data on the serial monitor. It stops just in random places in the code and I tried to trace the reason of this issue but it seems random and no specific part caused this issue.

I am attaching a screenshot showing part of the code and the output in the serial monitor (which is not complete).
https://drive.google.com/file/d/0B48uMX ... sp=sharing

Please advise me about the issue. Is it because of the memory?

Looking forward for your help and feedback .

Regards,
Asiya

Author:  libelium-dev [ Fri Sep 08, 2017 7:31 am ]
Post subject:  Re: Serial Monitor Stops while sending serial data

Hello AsiyaM,

this behavior is a symptom of a RAM problem. We can give you and advice in order to help you, replace all your Serial.print to this:

Use this:
Code:
Serial.println(F("Filtered Signal:"));


instead of this:
Code:
Serial.println("Filtered Signal:");


Regards

Author:  AsiyaM [ Sun Sep 10, 2017 5:45 pm ]
Post subject:  Re: Serial Monitor Stops while sending serial data

Thank you for your reply.

What do you mean of a RAM problem?
Anyways, I have replaced the code with the one you suggested but still getting the same output on serial monitor.

Regards,
Asiya

Author:  AsiyaM [ Sun Sep 10, 2017 6:12 pm ]
Post subject:  Re: Serial Monitor Stops while sending serial data

I think yes this problem is caused by the RAM.
Because when I traced the following part of the code:

Code:
  float ECGtemp[N+22];
 
  Serial.println("here1");

  //memset(ECGtemp,0,sizeof(ECGtemp));
  for (j=0; j<N+22; j++)
        ECGtemp[j]=0;

   Serial.println("here2");


The output was :

Code:
here

Author:  libelium-dev [ Mon Sep 11, 2017 7:36 am ]
Post subject:  Re: Serial Monitor Stops while sending serial data

Hello Asiya,

It means that you do not have enough dynamic memory to store variables. Start with a basic code that works, and adds little by little your variables and code to check what the problem is.

Regards

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/