How to compile the MK3 firmware?
Hi guys!
Does anybody know how to build the MK3 firmware from sources?
I know I read somewhere Jo said that the Arduino bootloader is not used anymore.
I don’t want to brick my machine so I thought I would ask before I make an essential mistake.
So is it still compiled using Arduino IDE? Where could I find the einsy board target? What else to consider and prepare?
Thanks and regards
Re: How to compile the MK3 firmware?
Can still be compiled using the Arduino IDE, the build environment from Prusa is a good starting point, you export a hex file that you can use with the Prusa loader
Check this thread
This link
http://zaribo.org/blog/how-to-compile-and-modify-prusa-firmware-part-i-setting-up-the-environment/
I don't use 1.6 - been on 1.8+ for a while and I use it for other stuff and am not prepared to have multiple versions on my system which can lead to unpredictable results with Arduino.
First thing to do is get comfortable in the environment. Make sure you set things up for the LCD correctly (you need to rename the resident Arduino version or things get funky on the display).
You will find the firmware here
https://github.com/prusa3d/Prusa-Firmware/tree/MK3
There is a complete Arduino 1.6 environment ready made somewhere but blowed if I can find the link.
Re: How to compile the MK3 firmware?
Ok thank you for the links - I will look into those. I have worked with the Arduino IDE before, but with ESP8266 boards and ATTINYs.
Never (obviously) with the EINSY:-)
From reading just your posting until now, I did not understand what you mean about the LCD and renaming something - I guess you refer to the Library that drives the LCD? I hope it will make sense once I get to your links.
Re: How to compile the MK3 firmware?
So do I select "Rambo" as the board? I expected there would be an EINSY Rambo board option or something like this.
Re: How to compile the MK3 firmware?
Yes select Rambo as the board.
The inherent Arduino LCD library needs 'disabling' or you get character corruption.
A lot of the specifics are listed on the second link (zaribo), there aree even some powershell scripts to build the dev environment but if you're familiar with Arduino and use it for other things I'd recommend you 'DIY' it or you risk messing up your existing stuff.
Re: How to compile the MK3 firmware?
Yes select Rambo as the board.
The inherent Arduino LCD library needs 'disabling' or you get character corruption.
A lot of the specifics are listed on the second link (zaribo), there aree even some powershell scripts to build the dev environment but if you're familiar with Arduino and use it for other things I'd recommend you 'DIY' it or you risk messing up your existing stuff.
Argh! It does not work.
I am using Arduino 1.8.5. Which variants am I supposed to use? I thought to use the Arduino_1.x.x - but maybe I do have to use the Arduino_1.6.x?
The error is:
In file included from sketch/Marlin.h:23:0,
from sketch/thermistortables.h:4,
from sketch/Configuration.h:809,
from /Users/stahlfabrik/Documents/Arduino/Prusa-Firmware/Firmware/Firmware.ino:33:
pins.h:51: error: #error Unknown MOTHERBOARD value in configuration.h
#error Unknown MOTHERBOARD value in configuration.h
^
exit status 1
#error Unknown MOTHERBOARD value in configuration.h
I installed the board and selected RAMBO
I copied the 1_75mm_MK3-EINY10a-E3Dv6full.h file in the main folder and renamed it to Configuration_prusa.h
I moved the LCD thing out of the way
I restarted Arduino IDE
Do you have any idea what I could change?
EDIT: Installed now Arduino 1.6.13. The variants are now obvious - I still get the same error.
Re: How to compile the MK3 firmware?
You should not replace the Configuration_prusa.h file for the MK3, this is why you're getting the error.
All the files in the variants folder are outdated.
I compiled the MK3 firmware with Arduino 1.8.5 and it worked just fine.
Re: How to compile the MK3 firmware?
The .h file you copied does contain the wrong board ID - the file you copied has this line
#define MOTHERBOARD BOARD_EINY_0_4a
when it should be
#define MOTHERBOARD BOARD_EINSY_0_4a
unfortunately the files in variants do seem somewhat 'challenged' try mine (just unzip it first 😉 )- but be careful - all kinds of things get set in here for speed management etc.
Re: How to compile the MK3 firmware?
The .h file you copied does contain the wrong board ID - the file you copied has this line
#define MOTHERBOARD BOARD_EINY_0_4a
when it should be
#define MOTHERBOARD BOARD_EINSY_0_4a
unfortunately the files in variants do seem somewhat 'challenged' try mine (just unzip it first 😉 )- but be careful - all kinds of things get set in here for speed management etc.
OK! Thank you!
I corrected that stupid typo and now it progresses but still fails with this error:
sketch/Marlin_main.cpp: In function 'void fsensor_init()':
Marlin_main.cpp:1204: error: 'PAT9125_XRES' was not declared in this scope
int pat9125 = pat9125_init(PAT9125_XRES, PAT9125_YRES);
^
Marlin_main.cpp:1204: error: 'PAT9125_YRES' was not declared in this scope
int pat9125 = pat9125_init(PAT9125_XRES, PAT9125_YRES);
^
exit status 1
'PAT9125_XRES' was not declared in this scope
I used the ultimachine json to get the RAMBO boar definition - I have not moved any ArduinoAddon anywhere. Should I use the 1.X.X?
EDIT: I copie hardware and libraries from 1.x.x to my Arduino Sketchbook. Still the same error
EDIT2: Grepping for PAT9125_XRES in the firmware folder leads to no definition anywhere?!
EDIT3: I see that your Configuration_prusa file has the missing definition - as well as lots of others! Where is your file from? I would like to start with a complete and unmodified file (you said you modified things to your liking)
Re: How to compile the MK3 firmware?
As I said above, this is the only Configuration_prusa.h file you should be using:
https://github.com/prusa3d/Prusa-Firmware/blob/MK3/Firmware/Configuration_prusa.h
Re: How to compile the MK3 firmware?
Yup pretty much the one I started with - except mine was from 18th Dec - the one rajr2 linked too is the latest.
And yes in here you can change all kinds of things that will really mess you up if you don't have an idea what they do, I mod mine because I use a PT100 with amplifier which isn't enabled by default and a copper / nickel heater block.
Re: How to compile the MK3 firmware?
If you have pulled the MK3 branch (today) the Configuration_prusa.h file has the settings for "PAT9125_XRES".
However the instructions on github state to replace this file with one for your variant. None of the configuration files in the /variants folder have this definition.
just fyi -
I used the .json from ultimachine and the Boards Manager to add RAMBo to Arduino and this firmware compiles for me. However it is the wrong number of bytes as compared to the .hex provided from Prusa so I am not at all confident I've got the correct settings. this is just fyi - don't wish to derail the original conversation. I'll keep working on mine and post if I find something good.
Re: How to compile the MK3 firmware?
Oh my god! I just mved the file over. Did not noticed there it was already!
Thank you to all! Will try in da few hours!
Re: How to compile the MK3 firmware?
If you have pulled the MK3 branch (today) the Configuration_prusa.h file has the settings for "PAT9125_XRES".
However the instructions on github state to replace this file with one for your variant. None of the configuration files in the /variants folder have this definition.
I believe the instructions on Github are outdated. All I had to do to get a successful compile was to pull the Prusa git down to the local machine using GitHub Desktop, update the IDE boards library to get the latest Rambo definition, make sure to select the correct Mk3 branch in GitHub Desktop, and then open and run the compile from the 'Firmware' file in Arduino IDE 1.8.5. I didn't have to use old IDE versions, move any files, rename any files, nothing. 🙂 If you look at the beginning of the Configuration_prusa.h file you'll see it is for the Mk 3. I think the process has been much simplified, but the instructions haven't kept up.
I've been building and running it like this since my Mk 3 arrived before Christmas and it's always worked fine. You will get a warning about the missing bootloader, you can ignore that. The sketch at the moment with 143e is 230KB in length, which becomes 648KB when saved as a .hex file. (Use Sketch/Export compiled binary in the Arduino IDE and it will create Firmware.ino.rambo.hex in the project folder.)
PS - I'm doing this on a Mac, but I imagine it's the same process under Windows.
Re: How to compile the MK3 firmware?
Thank you! I just wanted to give my insights in this process but you pretty much nailed it!
I did not export the hex file because it already was were I expected: in the firmware folder.
I am also on the Mac.
The readme.md is ridiculous:-) If I should do a pull request?:-)
Basically its like:
1. git clone repo
2. git checkout MK3
3. Move LCD thingy out of the way
4. Install the board manager URL from ultimachine
5. select Rambo
6. Compile
7. Install hex
Don't move anything from git repo, don't rename anything there as well
Thank you all, that was awesome!
Re: How to compile the MK3 firmware?
Yep, that’s it!
However, I think you do need to export the hex file. What you might be seeing in the folder is the one you’ve pulled down from the Git that Prusa compiled.
PS I’m compiling myself because, even though I live in Texas which is normally much warmer than Prague, my garage is too cool right now (about 13C) and triggers the MinTemp errors. I reduce MinTemp to 10 so I can run the machine without having to get out the heat gun first! 😀
(I’m really not sure what it achieves having MinTemp set so high. The printer is quite happy working at 13C and it’s annoying that it won’t heat up at that ambient temperature.)
Re: How to compile the MK3 firmware?
You are right! Need to export:-)
RE: How to compile the MK3 firmware?
@lignumaqua
What's working for you now compiling on a Mac? I'm on 10.15.5 which is 64 bit.
Thanks,
John