Jump to content
Ultimaker Community of 3D Printing Experts
umagi

Why are Cura UM2 extended binary and Arduino built UM2 extended binary so different?

Recommended Posts

KakaoTalk_20160218_134513240.thumb.jpg.67c716c1a5da211319d5eeb44914e178.jpgHi,

I have built my own UM2 Extended (made it even higher + some small modifications for more rigid heated bed platform, see pictures) and am now in the process of compiling the UM2 Extended firmware (from the official git repository, UM2 branch).

KakaoTalk_20160218_134451389.thumb.jpg.372fda235763e6610c6c07ba45e277e2.jpgKakaoTalk_20160218_134455927.thumb.jpg.b3a10e489464b09606c11d3b4a0447dc.jpgKakaoTalk_20160218_134513240.thumb.jpg.8ef43cf294a2b91228ede2b3fdea1086.jpgKakaoTalk_20160218_134529570.thumb.jpg.aedad8ce9da3da18d9ede04381c632e7.jpg

I have first tried with the default UM2 extended firmware included in the latest Cura version (Cura 15.04.4)  and compared it with the .hex file built using the latest Arduino IDE (v1.6.7) on Windows.

Cura binary: Cura_15.04.4\resources\firmware\MarlinUltimaker2extended.hex

Source for Arduino build: https://github.com/Ultimaker/Ultimaker2Marlin

When comparing both .hex version using a hex file comparator, it is obvious that both files are very very different.

My question is therefore this:

How is the default UM2 extended firmware included in Cura built?

Why are the two images so different? Are they any extra libraries included in the Cura image? Different optimization? Different compiler?

I have many questions upcoming concerning the debug process of my self-built UM2, which boots but does not seem to home properly, and hope to get some help from experienced people here^^.

Many thanks for your help.

KakaoTalk_20160218_134513240.thumb.jpg.67c716c1a5da211319d5eeb44914e178.jpg

KakaoTalk_20160218_134451389.thumb.jpg.372fda235763e6610c6c07ba45e277e2.jpg

KakaoTalk_20160218_134455927.thumb.jpg.b3a10e489464b09606c11d3b4a0447dc.jpg

KakaoTalk_20160218_134513240.thumb.jpg.8ef43cf294a2b91228ede2b3fdea1086.jpg

KakaoTalk_20160218_134529570.thumb.jpg.aedad8ce9da3da18d9ede04381c632e7.jpg

Edited by Guest

Share this post


Link to post
Share on other sites

Even just changing one byte in the code will make the whole file different because now addresses of every jump (in machine code) have all moved. Or if you move the data by one byte then those all change. So comparing binaries that only had one tiny change will usually look completely different.

There might be a git tag somewhere - there should be - such that you can check out the exact version but really - the latest version is best anyway.

What doesn't home? X? Y? or Z?

Share this post


Link to post
Share on other sites

My question is therefore this:

How is the default UM2 extended firmware included in Cura built?

 

The build process of the whole bunch of different firmware versions is included in the Cura package script

As you can see - it uses the Makefile, not the Arduino IDE.

(side note: maybe it's different for the new (beta) Cura - i haven't compared it yet)

I'm still not sure, how the Arduino IDE compiles a sketch but i fear it compiles (and link) all files that are present in the Marlin folder. And there is a lot of stuff that is not needed (and not used) for the Ultimaker2.

Using "make" you will have a lot more control about the building process. I recommend to go this way.

 

Why are the two images so different? Are they any extra libraries included in the Cura image? Different optimization? Different compiler?

 

Probably all of this... (see above)

And keep in mind that the current branches are not always in a (directly) usable state. I recommend to start with the latest stable release (15.04.4 atm) - it's always better to use a steady starting point.

Have fun!

Share this post


Link to post
Share on other sites

Oh! You mean this?

 

$MAKE -j ${JOBS} HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2extended DEFINES="'STRING_CONFIG_H_AUTHOR=\"Vers:_${BUILD_NAME}ex\"' TEMP_SENSOR_1=0 EXTRUDERS=1"

 

I have always used the arduino IDE :(

I didn't know it added junk libraries. But it still fits on my um2go so maybe it's not critical?

What about for tinker Marlin? Do you also use make?

Share this post


Link to post
Share on other sites

Is there more information somewhere about where to get the same compiler version as UM?  What build environment is preferred?

 

You should ask daid, he's the guy that does the firmware building.

We do have some cmake scripts in the cura-build somehwere i believe.

Edited by Guest

Share this post


Link to post
Share on other sites

I have always used the arduino IDE :(

I didn't know it added junk libraries.  But it still fits on my um2go so maybe it's not critical?

 

Don't worry - the linker should throw away all unused stuff, it just takes a bit longer than it could...

 

What about for tinker Marlin? Do you also use make?

 

Yep, sure. It's much more convenient if you want to compile several variants from the same sources.

If you're interested: i use Arduino 1.6.5 at the moment and start this script from within GitBash.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!