Closed Zol-Tank closed 5 years ago
It looks like M100 is useable only with the AVR chips. Compiling for LPC1768 and DUE results in different names for the referenced variables/definitions.
Is there a problem you're trying to troubleshoot?
There isn't a problem I'm trying to troubleshoot, but with my new 32 bit boards I've gone kind of crazy with my enabled features and buffer sizes, and I just wanted to make sure I wasn't using too much memory. The Arduino IDE very helpfully tells me my memory usage upon compiling, but Atom doesn't (at least not that I can see), so I thought M100 would be a good way to do it.
The tweaks to get M100 working on 32-bit platforms should not be very much. The problem is I'm not setup to do 32-bit stuff right now. Finding the embedded variables from the link map should not be that hard if somebody is setup to do that.
On VSCode PIO does show the memory usage, but it's not at the very end of the output - it's a few dozen lines higher, above the list of platforms with [SKIP]/[ERROR]/[SUCCESS]. I would expect that Atom PIO also shows it.
Yes, PlatformIO shows the memory usage as stated above. PIO's output is the same on all platforms.
You know... M100 gives you memory information that the linker can't give you.
We should get M100 working on 32-bit platforms.
Fix on PR #13957
Fix on PR #13957
After applying that fix @robbycandra, I get this compile error for my SKR 1.3 LPC1768 board (Atom/platformio) ..
==================
Compiling .pioenvs\LPC1768\src\src\gcode\gcode.cpp.o
Linking .pioenvs\LPC1768\firmware.elf
c:/users/#####/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: .pioenvs/LPC1768/src/src/gcode/calibrate/M100.cpp.o: in function `check_for_free_memory_corruption(char const*)':
C:\Projects\3D Printer\Marlin 2\mine/Marlin\src\gcode\calibrate/M100.cpp:210: undefined reference to `__brkval'
c:/users/#####/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Projects\3D Printer\Marlin 2\mine/Marlin\src\gcode\calibrate/M100.cpp:210: undefined reference to `__bss_end'
c:/users/#####/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: .pioenvs/LPC1768/src/src/gcode/calibrate/M100.cpp.o: in function `GcodeSuite::M100()':
C:\Projects\3D Printer\Marlin 2\mine/Marlin\src\gcode\calibrate/M100.cpp:326: undefined reference to `__brkval'
c:/users/#####/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Projects\3D Printer\Marlin 2\mine/Marlin\src\gcode\calibrate/M100.cpp:326: undefined reference to `__bss_end'
collect2.exe: error: ld returned 1 exit status
==================
@doggyfan , I think thats not because of my PR.
My PR fix compile error if we enable M100_FREE_MEMORY_WATCHER, but disable M100_FREE_MEMORY_DUMPER.
I just created PR #13962 with an M100 that works with LPC1768 and SAM3X8E boards.
I did have to add fudge factors to keep out of some areas that the symbol tables implied were safe/unused. I think the DUE has some sort of memory protection for the RAM that has the stack as accessing that area results in an immediate reset.
PR #13962 has been merged.
Please close this issue if the new code works.
Lack of Activity This issue is being closed due to lack of activity. If you have solved the issue, please let us know how you solved it. If you haven't, please tell us what else you've tried in the meantime, and possibly this issue will be reopened.
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.
Description
Enabling M100_FREE_MEMORY_WATCHER using LPC1768 results in a compile error.
Steps to Reproduce
Expected behavior: Successful compile and M100 usable.
Actual behavior: Error during compile.
Additional Information
Marlin.zip