transistor-tester
transistor-tester copied to clipboard
Smaller firmware size
I found this bit of info is buried in the huge eevblog forum thread. Different versions of the avr-gcc compiler produce quite different firmware size. More recent versions of the compiler (version 12 at the time of writing) produce much larger firmware. A consensus on the eevblog thread is to use avr-gcc version 7.3.0. It is available in the old arduino-1.8.x IDE releases.
It is not necessary to disable SW_IR_RECEIVER with an older compiler. It's also possible to enable/disable more combinations of features since there is more space for customization..
Just posting this here because this repo comes up as a top result on search engines.
Thanks for the tip! I might test it the next time I'm building the firmware.
Just to add to this @ilarth and @blurpy ...
I have just pulled down the latest 1.50m firmware and configured it for this tester, and I used the very latest MSYS2 distribution, which comes with avr-gcc and tools available as packages (GCC 12.2) to compile it.
I ended up with firmware that was too large (104%). I then went in and tweaked the Makefile a little by adding two lines and uncommenting one that was already there:
CFLAGS += -fdata_sections -ffunction-sections CFLAGS += -flto
and
LDFLAGS += -Wl,--gc-sections
This brought the size down to 96%. Essentially what the new compiler switches do is put each function into its own section during compilation, and then the linker line removes any sections that remain unused after link time.
The LTO line turns on Link Time Optimisation for compilers that have been built with that enabled, and the latest MSYS2 avr-gcc has
@davydnorris Nice find! Will need to try that as well.