Arduino IDE versions and compile size

Code hacking talk

Arduino IDE versions and compile size

Postby revnull » 2016-Mar-Thu-15-Mar

TL;DR: Newer versions of the Arduino IDE software seem to have more efficient AVR tool chains.
Code: Select all
Arduino  0022 + teensyduino 1.10   = Binary sketch size: 121,806 bytes (of a 130,048 byte maximum)
Arduino  0023 + teensyduino 1.10   = Binary sketch size: 121,806 bytes (of a 130,048 byte maximum)
Arduino 1.0.6 + teensyduino 1.27   = Binary sketch size: 122,190 bytes (of a 130,048 byte maximum)
Arduino 1.6.7 + teensyduino 1.27   = Sketch uses 106,090 bytes (81%) of program storage space. Maximum is 130,048 bytes.
Arduino 1.6.8 + teensyduino 1.28b1 = Sketch uses 105,924 bytes (81%) of program storage space. Maximum is 130,048 bytes.

Not sure what version of teensyduino it uses.
PlatformIO 1.0.5  = Program:  106,140 bytes (81.0% Full)


I recently bought a RepRapDiscount Full Graphic Smart Controller clone in the hopes of getting to work with my Printrbot Simple Metal with Rev. F Printrboard. I grabbed the Marlin-RevF-Version-5.zip from Printrbot's git repo and tried making the proper edits to enable the display. Most wikis discribe how to setup 0022/23 or 1.0.5/6 with the correct versions of the teensyduino software. Using Arduino IDE 022, I was sad to find that the additional program space needed by the required U8glib lib and code was too large for the chip on my printrboard. This sparked a memory from another open source project that used the Arduino IDE with a modified AVR tool chain directly from Atmel that resulted in more efficient and smaller compiled code.

I decided to test multiple versions of the Arduino IDE with the compatible teensyduino libs. The tests listed above where run with unmodified Printrbot/Marlin code from the aforementioned zip file. It clearly (to me) shows that the newer versions of the Arduino IDE are leveraging Atmel's newer AVR tool chains resulting in smaller compiled bins. As a validate test, using the A1.6.7+T1.27, I re-enabled the #define REPRAP_DISCOUNT_SMART_CONTROLLER in the configuration.h and the build completed successfully.

Code: Select all
Sketch uses 127,818 bytes (98%) of program storage space. Maximum is 130,048 bytes.


Next step is to upload the hex and make sure everything still works. :)
  • 0

Last edited by revnull on 2016-Mar-Thu-21-Mar, edited 1 time in total.
revnull
Waiting to connect to printer...
 
Posts: 2
Joined: 2015-Jun-Sun-10-Jun
Reputation: 0

Arduino IDE versions and compile size

Sponsor

Sponsor
 

Re: Arduino IDE versions and compile size

Postby RetireeJay » 2016-Mar-Thu-17-Mar

Since you are obviously keen on collecting data, you might want to compare the hex size that you get if you use PlatformIO as your compiler. viewtopic.php?f=22&t=10160. I didn't try multiple generations of Arduino, but I did see a fairly substantial reduction in hex size when using PlatformIO. (I didn't record exactly how much :( )
  • 0

Printrbot Plus operational January 2013
Brass threaded rods (5/16" X 18) & nuts for Z axis
GT2 belts & pulleys
Cable chain to reduce probability of fatigue failure in wires
E3D V5 Hot End, 0.4mm nozzle, also 0.8 and 0.25 in use occasionally
PB fan mount + 40mm fan -- using printed mount adapter, not the E3D supplied fan
Injection molded extruder gears
Optical Z "endstop" (custom designed and built)
Have used many pounds of T-Glase filament. Now also doing some work with Ninjaflex SemiFlex
Print on glass with Scotch Craft Stick or other glue stick
User avatar
RetireeJay
My next printer is...
 
Posts: 4798
Joined: 2013-Jan-Wed-13-Jan
Location: Greenville, SC
Reputation: 477

Re: Arduino IDE versions and compile size

Postby thawkins » 2016-Mar-Thu-19-Mar

RetireeJay wrote:Since you are obviously keen on collecting data, you might want to compare the hex size that you get if you use PlatformIO as your compiler. viewtopic.php?f=22&t=10160. I didn't try multiple generations of Arduino, but I did see a fairly substantial reduction in hex size when using PlatformIO. (I didn't record exactly how much :( )


Platformio also gives more access to the gcc flags on the compiler and linker, while they can be described as requiring a degree in brain surgery to comprehend some of them, there are some that can influence executable size considerably, particularly the -Ox flags. Which allow you to select speed or size optimizations. The arduino IDE tends to apply very conservative optimization flags.

This thread may be of interest.

https://forum.arduino.cc/index.php?topic=343730.0
  • 0

Jonbot+
225mm x 200mm - Heated Bed
RAMPS 1.4 running Marlin 1.1.0
Full Graphic display.
-------------------------------
Zen Toolworks CNC/3d printer
230mmx360mm bed
Dual j-head hotends.
Dual heated beds.
RAMPS 1.4 running Marlin 0.98
-------------------------------
Flashforge 3d Creator Pro
Dual Extruder
220x143x150mm
Mightyboard rev e, runnimg Sailfish 7.7r1234
-------------------------------
Photon, self designed printed printer.
User avatar
thawkins
Print winner 2nd
Print winner 2nd
 
Posts: 1636
Joined: 2013-Aug-Sun-10-Aug
Location: Manila, Philippines
Reputation: 172

Re: Arduino IDE versions and compile size

Postby revnull » 2016-Mar-Thu-22-Mar

Added PlatformIO numbers as requested.

One more bump in the road to full graphic LDC goodness. Since my printrboard is based on the teensylu, it looks like I have less program space than I thought.

teensylu.upload.maximum_size=122880

I assume the rest of the space is taken by the DFU bootloader? Looks like I'll have to dig deeper to find things to remove. Anyone have any luck removing SD card support? I don't use it, and thanks to octoprint, I don't need it.
  • 0

revnull
Waiting to connect to printer...
 
Posts: 2
Joined: 2015-Jun-Sun-10-Jun
Reputation: 0

Re: Arduino IDE versions and compile size

Postby Mooselake » 2016-Mar-Fri-09-Mar

The Arduino 1.6.7/8 and platformIO numbers are pretty close. Iirc pIO's biggest advantage was smaller size from better use of the linker removing redundant library copies. Maybe a bit of competition was good?

Be interesting to see if there's any difference in maximum or smoother step rates, or reliability, but that takes test gear most if us don't have.

Kirk
  • 0

Modified KickStarter Classic Plus 7/2012
KS Thingybot Delta Pro 10/31/16
User avatar
Mooselake
My next printer is...
 
Posts: 3509
Joined: 2011-Dec-Tue-23-Dec
Location: Moose Swamp, Upper Michigan, USA
Reputation: 170


Return to Hack talk

Who is online

Users browsing this forum: No registered users and 1 guest