Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sketch to big to fit into Arduino UNO memory #611

Open
mikh3x4 opened this issue Feb 9, 2024 · 1 comment
Open

Sketch to big to fit into Arduino UNO memory #611

mikh3x4 opened this issue Feb 9, 2024 · 1 comment
Labels
question question

Comments

@mikh3x4
Copy link

mikh3x4 commented Feb 9, 2024

I've downloaded the newest master branch and loaded with a simple config generated by the web tool (I attached the config file). My Arduino IDE says it uses too much of program memory "Sketch uses 33024 bytes (102%) of program storage space. Maximum is 32256 bytes." I also tried compiling it with the -Os and -Oz flags to reduce the program size but with no luck.

I've been able to get it compile by turning off some options (DISABLE_PROBING_SUPPORT, DISABLE_COORD_SYS_SUPPORT, DISABLE_G10_SUPPORT, DISABLE_PATH_MODES) that were turned on be default. I think the web tool should automatically disable some of those options

ucnc_build.json

@mikh3x4 mikh3x4 added the bug Something isn't working label Feb 9, 2024
@Paciente8159 Paciente8159 added core: config core: configuration files question question and removed bug Something isn't working core: config core: configuration files labels Feb 9, 2024
@Paciente8159
Copy link
Owner

Paciente8159 commented Feb 9, 2024

This is a intrinsic problem with Arduino IDE. The compiled binary is bigger than the one generated via VSCode because you cannot customize the building flags (not without messing with the Arduino IDE platform.txt file).
The default configuration can be build...just not with Arduino IDE.

If you know how to tweak the build flags on Arduino IDE use the ones that are used inside the avr.ini file in the uCNC/src/hal/board/avr/ dir to be able to build a better/optimized version of the binary.

EDIT
As a reference the default master branch compiled for UNO produces a binary with this size:

RAM:   [=======   ]  66.8% (used 1368 bytes from 2048 bytes)
Flash: [==========]  98.4% (used 31748 bytes from 32256 bytes)

On Arduino IDE 2.2 the same compilation produces this:

Sketch uses 34030 bytes (105%) of program storage space. Maximum is 32256 bytes.
Global variables use 1398 bytes (68%) of dynamic memory, leaving 650 bytes for local variables. Maximum is 2048 bytes.

It's a significant difference..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question question
Projects
None yet
Development

No branches or pull requests

2 participants