PlatformIO Community

Error on build just as it finishes linking

I am new to all this stuff, but, I was building error free while trying to fix an issue with bed size and print size. I got it all working except z-axis is printing 2x higher than it should be, the test 20mm cube comes out 20x20x40. I made a change to configuration_adv.h file (I changed the Z_MICROSTEPS) and now it gives this error when building

Linking .pio\build\LPC1768\firmware.elf
c:/users/doug/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: .pio/build/LPC1768/src/src/HAL/HAL_LPC1768/DebugMonitor.cpp.o: in function `HardFault_HandlerC':
c:\Users\doug\Desktop\MarlinFirmware/Marlin\src\HAL\HAL_LPC1768/DebugMonitor.cpp:204: undefined reference to `watchdog_init()'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\LPC1768\firmware.elf] Error 1

I even went and used CTRL-Z to undo every change I made today to both configuration.h and configuration_adv.h. Both files are at the point where I had no issues with building, and it still cannot build anymore. I am not a developer, the only source I edit are those 2 files.

Which branch / version of Marlin are you using exactly?

I am using Marlin-bugfix-2.0.x with a 32 bit motherboard from Monday this week.

Do you have the file https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp? The implementation is there. It is guarded by #if ENABLED(USE_WATCHDOG) though, but also all calls in the DebugMonitor.cpp are guarded by the same macro.

So my first guess would be to do a complete project clean pio run -t clean or “Clean” in the project tasks and do a rebuild. If the error occurs, double check your definitions for USE_WATCHDOG in the configuration header files, and try disabling or enabling it.

Oh ehm, well, it looks like this is the exact problem fixed by this recent commit (which you don’t seem to have)

You might just have an older code version. Pull the repository again to merge the remote changes.

Ok, thanks. Have to wonder why it just started up today. Ran the clean as well, it removed 619 files in under 20 seconds. Would aborting a build with CTRL C cause this to occur? I don’t recall the when I did that, in relation to this happening, but I did abort a build, I had the touch screen connected and had to disconnect it prior to updating firmware. It still would not build after the clean ran so I pull the source again, put my 2 conf…h files where they belonged, and it can build again.

1 Like