Firmware images

What is the meaning of minor and major image files of the firmware?

The minor is used to build the major

Thanks ! What is the difference minor and major ?

Major: firmware package containing multiple minor packages
Minor: Individual firmware update, for example, touchscreen, controller, module firmwares, with firmware binary and attached metadata

Firmware packing process takes one or more firmware.bin compiled binaries and attaches metadata (such as version number and type of firmware) to create multiple minor images. Then combine all of minor images into a major image.

2 Likes

Thanks @brent113 . That was quite informative.
And how does one combine all the bin files ?
I saw that there is a way trough LUBAN and I tried to combine the bin from controller and from module, But the converted file is always a trash file.
Do you know any other way?

There are instructions on github for building and loading your own custom firmware, which is what I’m assuming you are trying to do here.

GitHub - Snapmaker/Snapmaker2-Controller: Snapmaker2-Controller is the firmware for Snapmaker 2.0 3-in-1 3D Printers.. I use VSCode to pack. If I have multiple firmware bins to load I do it with separate major packages, I don’t bother combining. The VSCode python pack modules has the ability to combine them, you’ll have to read through it if you need to use it.

Program compiled firmware to main controller

With PlatformIO CLI

After building, type below command in VSCode terminal

> pio run -t pack

Then you will get below firmwares in the folder (PROJECT FOLDER)/release :

  • firmware.bin : raw binary of firmware.
  • firmware.elf : firmware with debug information.
  • SM2_MC_APP_{xxx such as V4.0.0}_{xxx such as 20201222}.bin : minor image of module, can be used to generate major image
  • Snapmaker_{xxx: version such as V4.0.0}_{xxx: date such as 20201222}.bin : major image which can be used to upgrade modules with USB stick

Finally, copy the major image to your USB stick and upgrade your machine follow the instructions in How to update Firmware section.

With Luban

You need to install Luban to package the compiled firmware.

First, Open SettingsFirmware Tool in Luban, upload the compiled firmware.bin , click Compile and Export . You will get a file with name like Snapmaker2_V3.2.0_20201117.bin , this is the packaged update file to be programmed.

Then, Update your firmware via USB follow the instructions in How to update Firmware section.


Python pack module:

1 Like

Thanks @brent113 that was really helpful.

If i compile my own firmware and the pio compile and pack processes work and say success at the end I am generally in good shape (i just cloned main with a recent PR that was accepted and want to test it…)

Is this a statement or a question lol. Yes, should be. Make sure you grab the major image and not the minor or other 2 files.

The compile will throw many warnings because which developers ever actually fix warnings lmao not these guys.

I tried to compile the Snapmaker 2.0 controller firmware following the instructions here https://github.com/Snapmaker/Snapmaker2-Controller, and it worked great (except all the warnings brennt113 mentioned, but ignored them as recommended).
I was also happy to end up with all the 4 bin files mentioned in the instructions.

But when I checked the files sizes it becomes strange: I compiled version 4.14.7 and the files are significant smaller than the files you can download from here https://support.snapmaker.com/hc/en-us/sections/4419429929367-A-AT-F-Models:
my firmware.bin has 240 KB and Snapmaker_V4.4.17_20220708.bin (outcome of the pio run -t pack command) has 242KB (both found in the release folder), while Snapmaker2_V1.14.3.bin (updated on Jun 28, 2022) downloaded via “Firmware” button on page above has 68,465KB.
Since also the version numbers are quite different (4.4.17 probably the controller version number and 1.14.3 the one for the touchscreen) I’m confused even more about the outcome of my build vs the official download.

Anybody who can advice on what I’m missing or doing wrong ?
Uef

The version you compiled only contains the firmware for the controller. The download on the site also includes the full firmware for the touch screen.

That explains the difference.

Thanks !! Makes sense :slight_smile:
What’s required to build a full firmware ?

Access to the non public repository.

Unfortunately they haven’t made the software for the touchscreen available :confused:
So it’s not possible to reproduce the full firmware.

Actually, the “touchscreen firmware” (“HMI” in SM code) is just an Android app, you can see the apk contents by just unzipping the bin file from the downloads page. If you really want, you could decompile the dex files back to java, but IIUC, you can’t actually modify and recompile back since it probably does a signature check when updating the “app” that is all of the touchscreen code (I haven’t tried out of fear of getting the HMI into some irrecoverable state). It’d mostly be only useful for exploring logic that happens when the machine firmware sends requests over to the HMI.

Also, it’s pretty funny to see that they are apparently compiling the Android app for all the various architectures, it’s a pretty big waste of space to keep all that around. (Also also, you can install the fab updating app on your phone if you want, it’s an app they have in their app, and seems again pretty useless and bloated with unnecessary layouts/resources).

Overall, you’re not missing too much (valuable stuff) from the larger firmware when compiling the machine only firmware.

This brings up an interesting point. It might be possible to install Klipper on the Controller, and replace the TouchPad with KlipperScreen. If I remember correctly, Klipper now has full support for CAN, so as long as there is a boot loader for the microcontroller in the Controller, it should be possible.

I’m intersted in this also, however I belive there would have to be the controller firmware compiled before that would work. Klipper uses a small firmware so it can control the printer and the main klipper install on the raspberry pi which does all of the heavy lifting features. I’m assuming the controller is proprietary and not documented and would have to be entirely replaced but maybe?

It would however add some amazing features. The input shaper alone allowed me to take my Creality S1 to over 100mms print speed with no disernable loss in print quality.

Hey people.
Has anyone tried Klipper?