Sketch does not work anymore after updating to IDE2

I have just installed the latest version of IDE2 and uploaded my sketch to my arduino mega but now the arduino does not work anymore with my sketch. And even worse, it also does not work anymore if I upload it with 1.8.13 (which I was previously using.
The Arduino works ok when I upload the hex file (that I made before in 1.8.13) with XLoader.
I tried debugging the error but also on the serial monitor I do not get any data. It looks like the loop is not executed at all.
Any help is greatly appreciated as it looks like IDE2 corrupted my data.

Hi @robteg. The most likely cause of the problem you are experiencing is that you have a different version of a boards platform or library dependency of your sketch installed now than you did at the time you compiled the working binary.

It is much less likely that the problem is caused by "IDE2 corrupting your data" as you guessed.

The helpers here on the forum can probably provide assistance, but they would need to see your sketch code to do that.

Hello,

Thank you for your reply. I did see that the IDE2 did some library updates but I have no idea which ones are updated.

How can I check this?

And what do you mean by different version of board platform?

P.S. as mentioned the sketch does also not work anymore if I open in 1.8.13. But I guess the board platform and libraries are still the same there? So that should work but it does not.

No. They are shared (unless you used a portable install of 1.x which I doubt based on you issue).

Board package
IDE2.x puts the board packages in the Arduino15 directory; where that is depends on your operating system.
IDE1.x puts them there when you upgrade the board package.

Libraries
The board package includes some standard libraries like SPI, Wire and HardwareSerial (there are others) that are specific to the hardware (read: board)
3rd party libraries go in the libraries directory in the sketchbook.

Notes:

  1. Although this is not what you want to hear, you might have "found" a bug in your sketch. I would give that a high probability.
  2. IDE1.x comes standard with a board package; locate the Arduino15 directory and move the board package out of the way. Next start IDE 1.8.13 and see if it solved the issue.

Hi,

Can you help me out please? I am quite desperate as none of my sketches are working anymore (both in 1.8.13, 1.8.19 and 2.2.1) since the update to IDE2.

I installed IDE2 in 2 pc’s this morning and I have exact the same problem in both PC’s.

How can I fix this?

Thanks for your help.

Just tested my sketches on a 3rd pc which has only IDE 1.8.13 installed and my sketches are still working on that PC.

So I have no idea what happens when IDE2 is installed but it does change something and apparantly it also changes something in the IDE1 setup as after the update to IDE2 also sketches uploaded to the Arduino by IDE1 don’t do anything anymore on the arduino Mega 2560.

I really like to start using IDE2 as it has some interesting new features but hope you can help to sort this out.

Thanks.

Sorry, I did not realize that replying to an e-mail would also update the thread here.
I will test this and come back here. Thanks for the suggestion.

I can not find the Arduino15 directory you are referring to. I run Win10 Pro on both pc's. Can you point out where to look for that directory?
I use the Mega2560 board so we did not setup any specific board.
You also said that I might have a bug in my sketches. Can you be a bit more specific?

You now have a working setup with 1.8.13. Check which version of the board package is installed. Next, on the problematic PCs with IDE2.x, downgrade the board package to the same version using the board manager.

1 Like

I can not give you the exact path at this moment; it should be something like c:\users\yourUsername\AppData\......; the directory might be hidden so in windows explorer you will have to unhide it (show hidden and system files or something like that).

I do not know what specifics you want. A newer version of the compiler can result in a different layout of variables in memory, even with the same core and libraries. As a result, a bug that touches memory that it's not supposed to touch (e.g. writing outside boundaries of arrays) can in the one case result in a crash and in an other case go unnoticed because it e.g overwrites a memory location that is not used.

If the core files change or library files change, the same will apply regarding memory layout, even when using the same compiler version.

you nailed it! IDE2 apparantly installed Arduino AVR boards 1.8.6 and now I went back to 1.8.3 and all works again (both in IDE1 and IDE2).
That makes me wonder if there is no backwards compatibility in this board library? And what can possibly have changed that stops my board from working?

I'm reasonably sure the board package is backward compatible; you might have found an (obscure) bug that nobody has found yet. My bet will however still be on a bug in your sketch. If you want it to be analysed, I suggest that you start a new topic in Programming - Arduino Forum and provide the details (avr boards 1.8.3 vs 1.8.6 as well as exact details of libraries used) and post a link to the new topic in a reply here.

You can see the changes that occurred between Arduino AVR Boards version 1.8.3 and 1.8.6 here:

https://github.com/arduino/ArduinoCore-avr/compare/1.8.3...1.8.6

Did you check versions 1.8.4 and 1.8.5 to see if the problem still occurs when using those versions? Determining the exact point where the breakage occurred can help to identify the relevant change by reducing the changeset to be considered.

it stops working at 1.8.4. So 1.8.3 is the last working version.

I was also looking at this page Releases · arduino/ArduinoCore-avr · GitHub but here 1.8.4 is missing.

I have also just discovered this problem.
I am ESP 32 devboard programed using 1.8.3 is happily running a task but wanted to update and modify the code. I loaded the code into the IDE and ran a compile check (thankfully) before modifications and it throws up all sorts of issues.
What a pain. What is the point of an upgrade that is going to produce so many problems?
Now I have to spend hours resolving issues that previously didn't exsist Grrrr!

@dogbot57

If you have both 1.8.3 installed and 2.2.1 installed and never updated board packages / libraries after the installation of IDE 2.2.1, I can't think of a reason why it would give you problems.

If you however have removed all stuff related to IDE 1.8.3 or you got a new computer and did a fresh install of IDE 2.x (or any other IDE 1.8.x), you have probably installed the latest versions of those board packages / libraries and that would be where it went wrong.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.