AutoBuildMarlin icon indicating copy to clipboard operation
AutoBuildMarlin copied to clipboard

How to properly add build flags and/or custom environment for memory tuning

Open bengalih opened this issue 5 months ago • 1 comments

Trying to follow this: https://thborges.github.io/blog/marlin/2019/01/07/reducing-marlin-binary-size.html

which states:

If you are using PlataformIO, it is easier. Just create a new build target in platformio.ini, copying the original config for your printer board and add the new flags:

> build_unflags = -g -ggdb
> build_flags   = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues

I can do something like this at the bottom of platformio.ini:

[env:mega2560_memory_fix]
platform         = atmelavr
board            = megaatmega2560
framework        = arduino
extra_scripts    = ${common.extra_scripts}
build_unflags    = -g -ggdb
build_flags      = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues
lib_deps         = ${common.lib_deps}
monitor_speed    = 250000
monitor_eol      = LF
monitor_echo     = yes
monitor_filters  = colorize, time, send_on_enter

But I don't know how to call upon this from AutoBuildMarlin to properly attempt a build and upload with these fixes.

bengalih avatar Sep 22 '24 01:09 bengalih