Avisos
Vaciar todo

Compiling and Uploading Firmware yourself -How To ?  

  RSS
Chocki
(@chocki)
Prominent Member
Compiling and Uploading Firmware yourself -How To ?

Can someone please document the steps necessary to compile and upload firmware yourself as most of the information is outdated and no longer works especially now that Prusa have changed the boards definition so you have to use PrusaResearch Rambo as the target board.

Please start with Correct as of (current date).

Ideally with instructions for Mac, Windows and Linux flavours and Target Printer.

(Since I have never done this myself, I am not really experienced enough to document the steps and would like to know how to do this.)

 

Thanks

Normal people believe that if it ain’t broke, don’t fix it. Engineers believe that if it ain’t broke, it doesn’t have enough features yet.

Respondido : 16/08/2019 3:25 pm
me gusta
vintagepc
(@vintagepc)
Miembro
RE: Compiling and Uploading Firmware yourself -How To ?

Linux:

edit Firmware/config.h to use primary language only.

Then:

chmod +x PF-build.sh
./PF-build.sh
<follow the prompts>
Respondido : 16/08/2019 4:02 pm
Chocki
(@chocki)
Prominent Member
Topic starter answered:
RE: Compiling and Uploading Firmware yourself -How To ?

???What, no need to install an Arduino IDE or anything else?, just type the above and follow prompts?, is it as easy as that?.

Maybe time I looked at running a virtual machine with Linux. (Currently on Windows 10).

Normal people believe that if it ain’t broke, don’t fix it. Engineers believe that if it ain’t broke, it doesn’t have enough features yet.

Respondido : 16/08/2019 5:17 pm
vintagepc
(@vintagepc)
Miembro
RE: Compiling and Uploading Firmware yourself -How To ?

Nope. And the chmod is only necessary the first time around to designate the build script as an executable. 

 

Respondido : 16/08/2019 6:08 pm
Chocki
(@chocki)
Prominent Member
Topic starter answered:
RE: Compiling and Uploading Firmware yourself -How To ?

Maybe time to look at ubuntu and linux as I have no idea what chmod +x PF-build.sh does, or how to use linux... 🤨 

 

 

Anyway, so that's linux covered!....

Esta publicación ha sido modificada el hace 5 years por Chocki

Normal people believe that if it ain’t broke, don’t fix it. Engineers believe that if it ain’t broke, it doesn’t have enough features yet.

Respondido : 16/08/2019 6:50 pm
Dave Avery
(@dave-avery)
Honorable Member
RE: Compiling and Uploading Firmware yourself -How To ?

i found the how-to instructions from prusa were not hard to follow for windows - just make sure you follow them exactly and don't skip any steps

Respondido : 16/08/2019 6:52 pm
--
 --
(@)
Illustrious Member
RE: Compiling and Uploading Firmware yourself -How To ?
Posted by: chocki

Maybe time to look at ubuntu and linux as I have no idea what chmod +x PF-build.sh does, or how to use linux... 🤨 

Anyway, so that's linux covered!....

Think DOS, but one that has features you want to use.  DOS today has two shells : cmd and powershell, and one GUI (Windows).  The available distributions (what's included), shells (command line UI) and GUI's available will make your head swim - best to choose one and get used to it; if it gets finicky for how you use the machine, install a different shell or GUI.  As for  chmod, it's to change modifiers, or in DOS speak change file attributes (read/write/hidden/...).  If you've ever used DOS at the command line, and were proficient at it LINUX will be easy to absorb.

Esta publicación ha sido modificada el hace 5 years 2 veces por --
Respondido : 16/08/2019 8:06 pm
vintagepc me gusta
Chocki
(@chocki)
Prominent Member
Topic starter answered:
RE: Compiling and Uploading Firmware yourself -How To ?

Aha, It's beginning to make sense now: https://github.com/prusa3d/Prusa-Firmware/blob/MK3/PF-build.sh

This is the script that does all the hard work for you.

So basically you download the complete firmware zip and extract it in Linux, change the attributes of PF-build.sh to make the script executable using chmod +x

then run the script using ./PF-build.sh

And at the end you have a compiled piece of firmware ready to upload to your printer.

 

Normal people believe that if it ain’t broke, don’t fix it. Engineers believe that if it ain’t broke, it doesn’t have enough features yet.

Respondido : 16/08/2019 8:23 pm
vintagepc me gusta
Chocki
(@chocki)
Prominent Member
Topic starter answered:
RE: Compiling and Uploading Firmware yourself -How To ?

My Setup, Prusa i3 Mk3 and my PC is running Windows 10 Professional.

I created a virtual machine using Hyper-V Manager which has Ubuntu 18.04.2 LTS running on it.

For anyone who wants to try this method:

From the start menu go to Windows Administrative Tools and in this folder you will find Hyper-V Manager and Hyper-V Quick Create. Use Hyper-V Quick create to make a Ubuntu image, the selection is already there, just select it. If you get asked, then create a shared drive with one of your hard disks.

Very important: Do not select Automatically log in, but make sure you use a username and password every time.

Once you have the virtual machine made, if not already running, open Hyper-V Manager.

This is where you will may need to alter the network settings.

On the right you should see Virtual Switch Manager... click on this and select New Virtual Switch and in Connection Type, What do you want to connect this virtual switch to?, select External network. From the drop down, select your Windows PC network adaptor, in my case the Intel(R) 82579V Gigabit Network Connection.

On mine the Allow management operating system to share this network adaptor is ticked.

Then click OK. You should now be able to right click the virtual machine and start it and at the bottom of Hyper-V manager open the Networking Tab and you should see the Ubuntu VM get an IP address.

Right click the Ubuntu entry in Virtual machines and click on connect. You should see a Login to your virtual machine box, leave Xorg and type in your username and password for your Ubuntu Virtual machine and you will now connect to Ubuntu.

Part two will continue below

Normal people believe that if it ain’t broke, don’t fix it. Engineers believe that if it ain’t broke, it doesn’t have enough features yet.

Respondido : 17/08/2019 7:35 pm
Chocki
(@chocki)
Prominent Member
Topic starter answered:
RE: Compiling and Uploading Firmware yourself -How To ?

If you don't have Hyper-V Manager on your computer then use VirtualBox. You can also run VirtualBox on a Mac.

 

Normal people believe that if it ain’t broke, don’t fix it. Engineers believe that if it ain’t broke, it doesn’t have enough features yet.

Respondido : 17/08/2019 8:01 pm
Chocki
(@chocki)
Prominent Member
Topic starter answered:
RE: Compiling and Uploading Firmware yourself -How To ?

Download the firmware file you want: https://github.com/prusa3d/Prusa-Firmware/releases

These are the official Prusa releases. I want the 3.7.2 version for the Mk3 so clicked on this which takes me to this page: https://github.com/prusa3d/Prusa-Firmware/releases/tag/v3.7.2

If you scroll down, you will get to a download called Source Code.zip, click on this and you will download the complete source code for the printer Mk2, 2S, 3, and 3S.

Extract the  zip to your Ubuntu shared drive.

There is no need to modify anything, just switch to your virtual machine and Ubuntu.

From the desktop select Files (The filing cabinet icon) and select Documents, it should be empty.

From the desktop open Shared drives and open your shared drive where you will find the firmware you have just extracted, copy this folder to your documents folder in Ubuntu.

Still in Documents, you will now see the folder Prusa-Firmware-3.7.2 in my case, right click it and select Open in Terminal. A terminal session will open you will see a line with this: 

username@username-Virtual-Machine:~/Documents/Prusa-Firmware-3.7.2$ 

Type ls and hit enter and you should see the folder listed including PF-build.sh

Now type: chmod +x PF-build.sh

now type: ./PF-build.sh

Ubuntu will now download all the files need to compile the firmware and install them, when it prompts you for Select a variant, then select your board. In my case 7 

When it prompts you to Select a language, select 2 English Only. If you select 1, the firmware will not work.

At the next Prompt Dev Status Unknown, select 1)Yes

The firmware will now be compiled, when finished, close the terminal window.

Back in documents, you will now see a few folders, open the folder in there in my case FW372-Build2363, then in this folder open the next folder, in my case BOARD_EINSEY_1_0a

Finally in here you will find the compiled firmware, in my case it is called FW372-Build2363-1_75mm_MK3-EINSy10a-E3Dv6full-EN_ONLY.hex

Copy this to your shared folder and finally shut down Ubuntu.

If you are modding FW, then just mod the files in your shared folder and copy over to your documents folder and run ./PF-build.sh and it will compile without having to download anything new.

If you are compiling new release FW then it is safest to delete everything in your Documents folder so that anything new or updated is downloaded the first time you run the PF-Build.sh script.

 

Thats it, dead easy, now flash as normal from PrusaSlicer.

Normal people believe that if it ain’t broke, don’t fix it. Engineers believe that if it ain’t broke, it doesn’t have enough features yet.

Respondido : 17/08/2019 8:51 pm
-- me gusta
Bunny Science
(@bunny-science)
Noble Member
RE: Compiling and Uploading Firmware yourself -How To ?

If, instead of linux shell, you wish to use desktop Arduino IDE, you can follow my directions at https://github.com/guykuo/Prusa-Firmware/tree/MK3-3.8.0-with-0.9-motors-LA15-Slice-Skelestruder-BMG

Just skip the stuff about setting up 0.9 degree motors and follow only the IDE setup and compilation directions.

The IDE is nice if you are doing any mods. Flashing is done directly from the Arduino IDE

Of course, you would grab the Prusa/MK3 3.8.0 source files, not my branch (unless you wanted my 0.9 motor, skelestruder, BMG, or Slice support)

Respondido : 17/08/2019 11:56 pm
teookie
(@teookie)
Eminent Member
RE: Compiling and Uploading Firmware yourself -How To ?

You can compile in windows 10 with PlatformIO
Here are the steps as I remember them:

1) install Visual Studio Code https://code.visualstudio.com/
2) from within VScode, install the PlatformIO extension https://platformio.org/
3) from the terminal in PIO, navigate to the "Prusa-Firmware" folder and run this command: "pio init -b reprap_rambo"
4) edit the platformIO.ini file to include:
[env:reprap_rambo]
monitor_speed = 115200
platform = atmelavr
board = reprap_rambo
framework = arduino
build_flags = -w -Os -Wl,-u,vfprintf -lprintf_flt -lm -Wl,--gc-sections

[platformio]
src_dir = Firmware
build_dir = out

5) toggle LANG_MODE in config.h to 0
6) click the build button on the PIO toolbar
7) your new firmware will be in the "out/reprap_rambo" folder

Respondido : 18/08/2019 1:50 am
LordMelkor
(@lordmelkor)
Eminent Member
RE: Compiling and Uploading Firmware yourself -How To ?
Posted by: @trent-t

You can compile in windows 10 with PlatformIO
Here are the steps as I remember them:

1) install Visual Studio Code https://code.visualstudio.com/
2) from within VScode, install the PlatformIO extension https://platformio.org/
3) from the terminal in PIO, navigate to the "Prusa-Firmware" folder and run this command: "pio init -b reprap_rambo"
4) edit the platformIO.ini file to include:
[env:reprap_rambo]
monitor_speed = 115200
platform = atmelavr
board = reprap_rambo
framework = arduino
build_flags = -w -Os -Wl,-u,vfprintf -lprintf_flt -lm -Wl,--gc-sections

[platformio]
src_dir = Firmware
build_dir = out

5) toggle LANG_MODE in config.h to 0
6) click the build button on the PIO toolbar
7) your new firmware will be in the "out/reprap_rambo" folder

Do you know if there are any differences between PlatformIO's "reprap_rambo" versus their "prusa_rambo"?

Respondido : 11/08/2020 6:07 pm
jsw
 jsw
(@jsw)
Famed Member
RE: Compiling and Uploading Firmware yourself -How To ?

Just for giggles here while I'm waiting for a print to finish, I gave this a shot.

I'm using the older Ubuntu 16.04 on the desktop here in the bedroom and not the newer one I use for most of the 3d work.

Surprisingly, this built without any issues first time and generated what looks like valid firmware in the form of

FW390-Build3421-1_75mm_MK3S-EINSy10a-E3Dv6full-EN_ONLY.hex

One of my spare-time endeavors is to learn the internals of the firmware to get a handle on exactly what does what and to know more about what is supposed to work when something does not work.  I now have a working study platform.

Off and on over the months I've tried some casual builds of Prusaslicer, both on older and newer Linux machines, and always ran into dependency and version issues, which I put off for maybe another day.  I asked a couple of times here in threads for people to please share some specific version and dependency info but received no responses that I'm aware of.

I'm glad this one went so smoothly.

Respondido : 13/08/2020 7:35 pm
Compartir: