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

[BUG] No warning on >100% RAM usage #26451

Closed
1 task done
non-bin opened this issue Nov 21, 2023 · 5 comments
Closed
1 task done

[BUG] No warning on >100% RAM usage #26451

non-bin opened this issue Nov 21, 2023 · 5 comments

Comments

@non-bin
Copy link

non-bin commented Nov 21, 2023

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

My original title for this was "Compiling with FT_MOTION causes firmware to lockup during boot", until I noticed
echo: Free Memory: -29396 PlannerBufferBytes: 1600 Negative free memory?
RAM: [==========] 193.5% (used 15849 bytes from 8192 bytes) 193%?

Boot messages and full Build log
start
PowerUp
 Brown out Reset
 Watchdog Reset
 Software Reset
Marlin bugfix-2.1.x
echo: Last Updated: 2023-11-21 | Author: (Alice, Creality Ender-5 Plus)
echo: Compiled: Nov 22 2023
echo: Free Memory: -29396  PlannerBufferBytes: 1600 <------------------------------- Negative free memory?
//action:notification Print Paused
echo:SD card released
echo:busy: processing

Then it locks up to the point were disconnecting and reconnecting serial console doesn't reset it, it has to be powered off and on

Executing task: C:\Users\jacka\.platformio\penv\Scripts\platformio.exe run --target upload 

Processing mega2560 (board: megaatmega2560; platform: atmelavr@~4.0.1; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/megaatmega2560.html
PLATFORM: Atmel AVR (4.0.1) > Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)
HARDWARE: ATMEGA2560 16MHz, 8KB RAM, 248KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
 - framework-arduino-avr @ 5.1.0
 - tool-avrdude @ 1.60300.200527 (6.3.0)
 - toolchain-atmelavr @ 1.70300.191015 (7.3.0)
Converting Marlin.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Wire @ 1.0
|-- SPI @ 1.0
Building in release mode
Compiling .pio\build\mega2560\src\src\HAL\AVR\HAL.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\AVR\HAL_SPI.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\AVR\MarlinSerial.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\AVR\Servo.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\AVR\eeprom.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\AVR\fast_pwm.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\AVR\registers.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\AVR\u8g_com_HAL_AVR_sw_spi.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\shared\Delay.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\shared\HAL.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\shared\MinSerial.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\shared\eeprom_api.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\shared\esp_wifi.cpp.o
Compiling .pio\build\mega2560\src\src\HAL\shared\servo.cpp.o
Compiling .pio\build\mega2560\src\src\MarlinCore.cpp.o
Compiling .pio\build\mega2560\src\src\core\serial.cpp.o
Compiling .pio\build\mega2560\src\src\core\utility.cpp.o
Compiling .pio\build\mega2560\src\src\feature\babystep.cpp.o
Compiling .pio\build\mega2560\src\src\feature\bedlevel\bedlevel.cpp.o
Compiling .pio\build\mega2560\src\src\feature\bedlevel\hilbert_curve.cpp.o
Compiling .pio\build\mega2560\src\src\feature\bedlevel\ubl\ubl.cpp.o
Compiling .pio\build\mega2560\src\src\feature\bedlevel\ubl\ubl_G29.cpp.o
Compiling .pio\build\mega2560\src\src\feature\bedlevel\ubl\ubl_motion.cpp.o
Compiling .pio\build\mega2560\src\src\feature\bltouch.cpp.o
Compiling .pio\build\mega2560\src\src\feature\cancel_object.cpp.o
Compiling .pio\build\mega2560\src\src\feature\e_parser.cpp.o
Compiling .pio\build\mega2560\src\src\feature\fwretract.cpp.o
Compiling .pio\build\mega2560\src\src\feature\host_actions.cpp.o
Compiling .pio\build\mega2560\src\src\feature\hotend_idle.cpp.o
Compiling .pio\build\mega2560\src\src\feature\pause.cpp.o
Compiling .pio\build\mega2560\src\src\feature\powerloss.cpp.o
Compiling .pio\build\mega2560\src\src\feature\runout.cpp.o
Compiling .pio\build\mega2560\src\src\feature\tramming.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\bedlevel\G26.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\bedlevel\G35.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\bedlevel\G42.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\bedlevel\M420.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\bedlevel\ubl\G29.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\bedlevel\ubl\M421.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\calibrate\G28.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\calibrate\M48.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\config\M200-M205.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\config\M220.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\config\M221.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\config\M301.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\config\M302.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\config\M304.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\config\M92.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\control\M111.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\control\M120_M121.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\control\M17_M18_M84.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\control\M211.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\control\M280.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\control\M80_M81.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\control\M85.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\control\M999.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\control\T.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\eeprom\M500-M504.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\advance\M900.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\cancel\M486.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\fwretract\G10_G11.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\fwretract\M207-M209.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\pause\G27.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\pause\M125.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\pause\M600.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\pause\M603.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\pause\M701_M702.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\powerloss\M1000.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\powerloss\M413.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\feature\runout\M412.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\gcode.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\gcode_d.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\geometry\G92.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\geometry\M206_M428.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\host\M110.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\host\M113.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\host\M114.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\host\M115.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\host\M118.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\host\M119.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\host\M154.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\lcd\M0_M1.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\lcd\M117.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\lcd\M300.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\lcd\M73.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\motion\G0_G1.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\motion\G2_G3.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\motion\G4.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\motion\G5.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\motion\M290.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\motion\M400.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\ota\M936.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\parser.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\probe\G30.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\probe\M401_M402.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\probe\M851.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\queue.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M1001.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M20.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M21_M22.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M23.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M24_M25.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M26.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M27.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M28_M29.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M30.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M32.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M33.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M34.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M524.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M808.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\sd\M928.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\stats\M31.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\stats\M75-M78.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\temp\M104_M109.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\temp\M105.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\temp\M106_M107.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\temp\M140_M190.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\temp\M155.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\temp\M303.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\temp\M86-M87.cpp.o
Compiling .pio\build\mega2560\src\src\gcode\units\M82_M83.cpp.o
Compiling .pio\build\mega2560\src\src\inc\Warnings.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\extui\dgus_reloaded\DGUSDisplay.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\extui\dgus_reloaded\DGUSRxHandler.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\extui\dgus_reloaded\DGUSScreenHandler.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\extui\dgus_reloaded\DGUSSetupHandler.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\extui\dgus_reloaded\DGUSTxHandler.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\extui\dgus_reloaded\definition\DGUS_ScreenAddrList.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\extui\dgus_reloaded\definition\DGUS_ScreenSetup.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\extui\dgus_reloaded\definition\DGUS_VPList.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\extui\dgus_reloaded\dgus_reloaded_extui.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\extui\ui_api.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\marlinui.cpp.o
Compiling .pio\build\mega2560\src\src\lcd\utf8.cpp.o
Compiling .pio\build\mega2560\src\src\libs\buzzer.cpp.o
Compiling .pio\build\mega2560\src\src\libs\hex_print.cpp.o
Compiling .pio\build\mega2560\src\src\libs\least_squares_fit.cpp.o
Compiling .pio\build\mega2560\src\src\libs\nozzle.cpp.o
Compiling .pio\build\mega2560\src\src\libs\numtostr.cpp.o
Compiling .pio\build\mega2560\src\src\libs\stopwatch.cpp.o
Compiling .pio\build\mega2560\src\src\libs\vector_3.cpp.o
Compiling .pio\build\mega2560\src\src\module\endstops.cpp.o
Compiling .pio\build\mega2560\src\src\module\motion.cpp.o
Compiling .pio\build\mega2560\src\src\module\planner.cpp.o
Compiling .pio\build\mega2560\src\src\module\planner_bezier.cpp.o
Compiling .pio\build\mega2560\src\src\module\printcounter.cpp.o
Compiling .pio\build\mega2560\src\src\module\probe.cpp.o
Compiling .pio\build\mega2560\src\src\module\servo.cpp.o
Compiling .pio\build\mega2560\src\src\module\settings.cpp.o
Compiling .pio\build\mega2560\src\src\module\stepper.cpp.o
Compiling .pio\build\mega2560\src\src\module\stepper\indirection.cpp.o
Compiling .pio\build\mega2560\src\src\module\temperature.cpp.o
Compiling .pio\build\mega2560\src\src\module\tool_change.cpp.o
Compiling .pio\build\mega2560\src\src\sd\Sd2Card.cpp.o
Compiling .pio\build\mega2560\src\src\sd\SdBaseFile.cpp.o
Compiling .pio\build\mega2560\src\src\sd\SdFatUtil.cpp.o
Compiling .pio\build\mega2560\src\src\sd\SdFile.cpp.o
Compiling .pio\build\mega2560\src\src\sd\SdVolume.cpp.o
Compiling .pio\build\mega2560\src\src\sd\cardreader.cpp.o
Linking .pio\build\mega2560\firmware.elf
Checking size .pio\build\mega2560\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==========]  193.5% (used 15849 bytes from 8192 bytes)
Flash: [========  ]  77.5% (used 196936 bytes from 253952 bytes)
Building .pio\build\mega2560\firmware.hex
Configuring upload protocol...
AVAILABLE: wiring
CURRENT: upload_protocol = wiring
Looking for upload port...
Auto-detected: COM4
Uploading .pio\build\mega2560\firmware.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.04s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: reading input file ".pio\build\mega2560\firmware.hex"
avrdude: writing flash (196936 bytes):

Writing | ################################################## | 100% 49.25s

avrdude: 196936 bytes of flash written
avrdude: verifying flash memory against .pio\build\mega2560\firmware.hex:
avrdude: load data flash data from input file .pio\build\mega2560\firmware.hex:
avrdude: input file .pio\build\mega2560\firmware.hex contains 196936 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 42.33s

avrdude: verifying ...
avrdude: 196936 bytes of flash verified

avrdude: safemode: Fuses OK (E:FD, H:D8, L:FF)

avrdude done.  Thank you.

================================================================================== [SUCCESS] Took 309.48 seconds ==================================================================================
Environment    Status    Duration
-------------  --------  ------------
mega2560       SUCCESS   00:05:09.482
=================================================================================== 1 succeeded in 00:05:09.482 =================================================================================== *  Terminal will be reused by tasks, press any key to close it. 

Bug Timeline

No response

Expected behavior

No response

Actual behavior

No response

Steps to Reproduce

No response

Version of Marlin Firmware

bugfix-2.1.x 2023-11-21 12881d5

Printer model

Ender 5 Plus

Electronics

Stock Creality V2.2 board

LCD/Controller

DGUS Reloaded

Other add-ons

No response

Bed Leveling

UBL Bilinear mesh

Your Slicer

None

Host Software

OctoPrint

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

config.zip

@EvilGremlin
Copy link
Contributor

This is not a bug, compiler/linker don't throw an error on RAM overflow. Won't be of much use because not everything is accouted for and you need to have some RAM free (500B at least)
Not sure if we can parse terminal output and throw error with script, probably no.

@non-bin
Copy link
Author

non-bin commented Nov 21, 2023

Fair enough, maybe I'll report it to pio then?

@EvilGremlin
Copy link
Contributor

It's not really pio either, it's gcc area. But pio could implement parse&error indeed.

@thisiskeithb
Copy link
Member

Fixed upstream in PlatformIO:

Copy link

github-actions bot commented Feb 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants