Go Down

Topic: arduino 12 compiled sketches keep resetting (Read 846 times) previous topic - next topic


Initially with 012 I was unable to compile my sketches since I was using

#include <Servo.h>
#include <FrequencyTimer2.h>

Mem suggested:

A number of people have reported similar problems. I think its caused by including wiring.h in the header file.  In FrequencyTimer2.h, try replacing
#include <wiring.h>  
#include <inttypes.h>

You may  need to to add
#include <wiring.h>  
to the FrequencyTimer2.cpp file just after the  #include <FrequencyTimer2.h>

This fixed the compiling but now I get a new problem that the code keeps crashing or causing the arduino to reset at what seems like random times.

When I go back to using 011 there is no problem with the same code.

any clues?


I don't know if the ram usage on 0012 is different from 0011 but if you were on the edge then that could be the cause. See if you can reduce the number of strings or other memory hungry variables and see if that stabalizes things.


When you compile the program what size does it report? Might be a clue.


I am only using about 8k.

I switched back to 0011 for this project but since it uses I2C I decided to try and get 0012 working again since I have been having lot's of bugs with I2C and want to see if the newer library with 0012 works better.

However I am still having the issue of the program not working under 0012 but worked fine under 0011.


I am only using about 8k.

That would be program space, not RAM.  Program space (FLASH) is a go/nogo condition.  Running out of RAM is harder to detect, and depends on how the code behaves when it runs.


Go Up