trying to compile my sketch on ide 1.8.6 for mega 2560 and sometimes it will compile and sometimes it wont. i can just sit there and hit verify and will will fail twice in a row then the next time compiles completely. i dont know if this is because of something im doing way wrong in the code or a program bug
Please provide the complete error message that you get.
sterretje:
Please provide the complete error message that you get.
whats the best way to upload the huge compiler console
i notice is complains about this when it fails
C:\Users\User\Desktop\my programs\main_sketch_4\main_sketch_4.ino:389:1: internal compiler error: Segmentation fault
}
this is the the code at line 389
void saveParam()
{
timerParams.EEPROMWriteCountTotal++;
EEPROM.put(keywordAddress, keyword);
EEPROM.put(paramAddress, timerParams);
setCycle(SENSNAN);
} //line389
This is a known bug and not related to your code (although adding or removing something or reshuffling fixes it).
Not sure of the exact details and what to advise; do a search on this forum on internal compiler error: Segmentation fault and look for answers by pert. He's extremely knowledgeable in this area.
If you don't come right, downgrading the IDE to version 1.8.5 and after that upgrading the board manager to version 1.6.21 should solve the problem.
sterretje gave a good answer, though I wouldn't say I'm even close to "extremely knowledgeable" on this. I was probably the first person to every encounter this bug, way back during the beta testing of the new toochain. However, even after a lot of research and experimentation, I have no clue what the specific cause or real solution is. I only have the workaround of not using the new toolchain. That's inconvenient for me because I'm still trying to beta test but also need to have a working toolchain. But for anyone else, the older toolchain will work fine.
If you don't want to go back to Arduino IDE 1.8.5, you can instead update to Arduino IDE 1.8.7 and then roll back your Arduino AVR Boards version to 1.6.21, following these instructions:
- Tools > Board > Boards Manager
- Wait for downloads to finish.
- When you move the mouse pointer over "Arduino AVR Boards", you will see a "Select version" dropdown menu appear. Select "1.6.21".
- Click "Install".
- Wait for installation to finish.
- Click "Close".
Due to a bug, this workaround doesn't work with Arduino IDE 1.8.6, but it will work with any other version of the Arduino IDE.
If you have File > Preferences > Check for updates on startup checked, the Arduino IDE may occasionally notify you that a new version of Arduino AVR Boards is available, you'll need to refrain from updating back to the new Arduino AVR Boards version, otherwise you'll be back to seeing the segmentation fault error again.