Discrepancies between compiling and uploading... Help needed

Hallo everyone,

I'm literally getting mad trying to understand and fix a problem that prevents to see my script eventually running. I'm not a genius in scripting, but I had enough arduino practice to manage a medium-complexity script (in this case a 3 axis cine-slider controller).
After several tests and debug everything goes ok, the script is perfectly compiled. But when I try to upload, it locks with a generic "error during uploading".
So, I empirically started to comment progressively smaller sections of the script, testing the upload each time, until I've found a line, a simple line with no particular relevance, just a reset of the variable after detecting the pushing of a series of buttons: commenting just that line the scripts uploads perfectly; inserting the line again the upload is blocked. Of course in both cases it compiles regularly.
Since this is not a syntax issue, I feel really lost and can't find a solution.
If someone has ideas or experienced such an issue, I'd appreciate much any help.
The code is attached, since it exceeds 9000 chrs.

Sorry forgot the attachment

sketch_mar24a.ino (10.4 KB)

Which line of code is it that causes the upload to fail?

Which version of the Arduino IDE are you using?

Please do this:

  • File > Preferences > Show verbose upload during: > upload (check) > OK
  • Sketch > Upload
  • After the upload fails you will see a button on the right side of the orange bar "Copy error messages". Click that button.
  • Paste the error messages in a reply here using code tags (</> button on the toolbar).