MEGA2560 REV3 serials do not work with new IDE (have to use IDE 1.04 or 1.06)

Hi there

We have an application that exchanges data continuously between a PC Windows (XP, Win7, Win10) and a MEGA 2560 (rev1 and rev3). There exists one message of less than 255 bytes every 100 ms from MEGA2560 and time to time asynchronous commands from PC. All this works fine for hours when downloading to MEGA2560 with old arduino IDE 1.04 or 1.06

But we have found in 2017 that if we download app to MEGA2560 with the "new" IDE 1.8, the serial line hangs after 5 to 30 sec. Everything seems like if the libc or the serial driver on board is simply wrong ...

We would like to know if something is known about this, nothing found on the net since then !

Best regards
J.N. Helal

Please post the code that you are using following the advice on posting code given in posting code

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

Older versions of the IDE use older versions of gcc. So the generated executable and memory layout can be different.

Because the executable and memory layout can be different different, the effect of possible issues (e.g. extensive use of Sting (capital S) concatenation or writing outside boundaries if arrays) in your code might now show.

If you suspect the IDE, start by writing small test scripts and testing that way.

Does your code use a switch/case statement? Iirc, there were some problems with jump tables constructed for these on Mega boards, in at least some versions of the new compiler. They might go away if you turn off lto optimization (ie using mcudude’s megacore instead of the arduino board def.