Arduino web editor and latest board give different results

Hi,

Few weeks ago I started to use Arduino create web editor and love it. For me it is very convenient. However I found a huge performance difference in a firmware were I use the CAN library and serial monitor on a Arduino Micro. When I increase the amount CAN/serial message, read/interrupts, the application fails. Then I compiled on my local environment and all is ok. Then I found out that it is related to the AVR board version I use. The older ones are ok and the newest one fails. I tested several times and see again and again the same result. With winmerge I compared the 2 environments but there is no difference at all. The only difference I found, when selecting 2 different board versions are a few files in the windows prefetch folder. Does any have clue what could cause this. The online web create compiler has the same issue.

thanks Han

Try systematically rolling back through each version of Arduino AVR Boards until you find which is the oldest one that causes the problem. You can easily do this in the Arduino IDE using Boards Manager (Tools > Board > Boards Manager).

If the application fails (crash at run time), you might have memory problems. The problem can be caused by differences how different versions of the compiler / linker lay out the memory; note that this is not a compiler / linker problem.

In random order, some possible causes 1) You run low on (RAM) memory which might result in corruption during interrupts or function calls; this is unlikely as newer linkers are supposed to optimise better. Check the amount of available dynamic memory after a verify. 2) You're writing outside the boundaries of arrays; the effects are always unpredictable and different memory layouts can result in different issues. 3) Use of String (capital S); it uses dynamic memory allocation and specifically generous use of concatenation can result in memory fragmentation. Again, effects are unpredictable and different memory layouts can result in different issues.