-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MK3 compilation issue with Arduino 1.8.x #614
Comments
I resolved this problem by commenting out the DBG lines in xyzcal.cpp. There is one line in particular that is the offender, but I cannot remember the exact one so I just commented all of them. I was using Arduino 1.8.5 on Mac High Sierra. |
Yes this is what I did (cf the diff), the issue is exactly this line:
|
I can confirm that reverting the change noted by murphy above will compile on 1.6.12 just fine. Surprised how fast it goes w/o errors. Was the printf_P() function not implemented in Sierra anymore? |
What OS it is running on shouldn't matter, since it is the Arduino headers that are used. |
it is strongly recommended to use older version "1.6.8", by which we can assure correct compilation results |
I use IDE 1.8.x since a while and had never issues, even saw that Prusa used newer versions than 1.6.8 in the past. Just tested IDE 1.68 with newest Release Source.zip https://github.com/prusa3d/Prusa-Firmware/archive/v3.2.0-RC1.zip and get the same error as in IDE 1.8.5 |
The issue reported by the OP is a problem in the avr-gcc compiler/linker in the Arduino IDE package (avr-gcc v4.9.2). The same GCC version is in both 1.6.x and 1.8.x IDE packages. The problem can be worked-around by removing the "link-time-optimization" (-flto) options from the build flags. The compiler options live the in PS - I do not have an MK3 to test the result on, so caveat user. |
I found it you are running the windows version and delete everything in the arduino folder including platform.txt then rerun 1.6.8 then add the missing additions to hardware and libraries everything works perfect. I have had compiling errors if I ran 1.6.8 then updated to a higher arduino versions on the same pc after deleting the folder and then running fresh all of my compiling errors vanished. |
@Crunch69 I would love to build with "official 1.6.8" but have this error when compiling:
I tried to remove all the app preferences and to use just Arduino 1.6.8 but same error. Any idea how to fix? |
This seems to be an Arduino issue with OSX Sierra, fixed in later Arduino releases (1.6.12+). It seems we can't officially use an old Arduino version forever. |
hello guys, problem is in compiler version, please use recomended version Arduino 1.68 and avr-gcc 4.8.1. More details in build instructions. |
@XPila How can we force to use avr-gcc 4.8.1? I don't see any mention in https://github.com/prusa3d/Prusa-Firmware |
murphy2712 that appears to be a MacOs issue are you on a mac? I provided instructions for a PC Can we close this as it is not an issue with the Firmware |
Yes, I'm on OSX.
|
Agree: not being compatible with the latest Arduino is one thing, but not compile on macOS is a nogo. I compiled happily 3.1.3 on macOS and it worked perfectly - with the latest Arduino IDE. Now this is a regression that needs to be fixed. |
Note that I could compile the git head of MK3 branch using arduino 1.8.5 (avr gcc version 4.9.2) with this change: diff --git a/Firmware/xyzcal.cpp b/Firmware/xyzcal.cpp #define _PI 3.14159265F -extern long count_position[NUM_AXIS]; uint8_t check_pinda_0(); In my humble opinion, if a variable is declared volatile in one file, it should be declared as such in all files the 'extern' it so that compiler which uses it doesn't apply extra optimizations. |
I must add also that I don't yet own the MK3 or any 3D printer if this matters, so I couldn't test if the result will actually work. The output from arduino was: Archiving built core (caching) in: /tmp/arduino_cache_849250/core/core_rambo_avr_rambo_09ff688e17cfe342a76c80acd8dcdce5.a |
maximlevitsky has the right fix to this problem. I successfully compiled the Mk3 firmware with Arduino 1.8.5 and avr-gcc\4.9.2 on Windows 10 with this simple addition of volatile to line 33 of xyzcal.cpp. |
Just a note, I use platformio and visual studio code to compile firmware and concur with @EeroFluge , adding ;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html
[platformio]
src_dir = Firmware
build_dir = .out
[env:reprap_rambo]
platform = atmelavr
board = reprap_rambo
framework = arduino |
I agree that adding this |
@XPila Any update on this? I am just curious if this is the correct fix for this issue. |
+1 that volatile keyword fixes the compilation. I just stumbled again across the fact that Arduino 1.6.8 does not work on Mac OS High Sierra at all. It does not compile - it is a know issue that got fixed later. |
@XPila sorry to bother you , but any update? |
Just updating that I successfully compiled RC 3.4.0-RC1 on 1.8.5 Windows Store 1.8.10.0. I haven't tried flashing at this time but I wanted to see if all the recent commits helped/worked. |
I was previously able to compile the MK3 firmware with Arduino 1.8.5 but recently it fails with this error message:
I was able to revert to a previous commit which worked fine, the failure starts from this commit:
67e90b5
I was able to pinpoint to this change:
Up until this commit no issue to compile (Arduino 1.6.12 or 1.8.5), but since this change, it fails.
I was even able to compile (and flash :P) the up-to-date MK3 branch by reverting these 2 lines.
Please revert these lines (or find a better fix!).
Thanks!
PS: I posted more details on this forum post: https://shop.prusa3d.com/forum/others-archive--f66/compiling-mk3-firmware-t15404-s10.html
I'm using macOS High Sierra (not sure if related).
The text was updated successfully, but these errors were encountered: