MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.23k stars 19.22k forks source link

[BUG] #21474

Closed Deneteus closed 3 years ago

Deneteus commented 3 years ago

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

Yes, and the problem still exists.

Bug Description

Cannot compile Wanhao D6 example profile without errors.

I had been wanting to create a new stock Wanhao D6 profile for 2021 and then add the changes for my Bondtech extruder & Microswiss hot end as well as enable some of the newer features such as LA 1.5 and the A4988 optimization settings that didn't exist in the original stock firmware. I had made one in 2019 but I lost the config files and had to start from scratch.

  1. I used Github Desktop and downloaded Gary Chen's original D6 configuration files. https://github.com/garychen99/Duplicator-6-firmware-version-3.1

  2. Downloaded the current version of bugfix-2.0.x code on 3/26/21. https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.0.x/config/examples/Wanhao/Duplicator%206

  3. Opened Beyond Compare and started copying over all the D6 specific defaults to the Bugfix configuration.h & configuration_adv files.

  4. Added all the config changes I wanted and then loaded it up in VSCODE.

  5. Nothing but errors. The first thing that I got an error about was that ATMEGA2560 couldn't be used and I got errors about the LCD. The Wanhao D6 uses the SSD1306 with a couple specific settings. I was able to resolve some of the errors but I was still left with some code issues having to do with the LCD.

  6. To be sure I wasn't crazy I made sure the configuration dates hadn't changed in github and I downloaded the D6 profile from configs and I still couldn't compile without the errors posted below.

Bug Timeline

New. Since the changes to the variable names.

Expected behavior

I expected it to compile without errors.

Actual behavior

Compiling .pio\build\mega2560ext\src\src\lcd\fontutils.cpp.o In file included from Marlin\src\lcd\dogm../menu/../marlinui.h:28:0, from Marlin\src\lcd\dogm../menu/menu.h:24, from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293: Marlin\src\lcd\dogm../menu/../buttons.h:164:0: warning: "BUTTON_PRESSED" redefined

define BUTTON_PRESSED(BN) (_BUTTONPRESSED##BN)

In file included from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:52:0: Marlin\src\lcd\dogm../ultralcd.h:150:0: note: this is the location of the previous definition

define BUTTONPRESSED(BN) !READ(BTN## BN)

Compiling .pio\build\mega2560ext\src\src\lcd\lcdprint.cpp.o

In file included from Marlin\src\lcd\dogm../menu/menu.h:24:0, Compiling .pio\build\mega2560ext\src\src\lcd\marlinui.cpp.o from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293: Marlin\src\lcd\dogm../menu/../marlinui.h:75:0: warning: "LCD_UPDATE_INTERVAL" redefined

define LCD_UPDATE_INTERVAL TERN(HAS_TOUCH_BUTTONS, 50, 100)

In file included from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:52:0: Marlin\src\lcd\dogm../ultralcd.h:77:0: note: this is the location of the previous definition

define LCD_UPDATE_INTERVAL TERN(HAS_TOUCH_XPT2046, 50, 100)

In file included from Marlin\src\lcd\dogm../menu/menu.h:24:0, from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293: Marlin\src\lcd\dogm../menu/../marlinui.h:63:8: error: multiple definition of 'enum LCDViewAction' enum LCDViewAction : uint8_t { ^~~~~ In file included from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:52:0: Marlin\src\lcd\dogm../ultralcd.h:65:8: note: previous definition here enum LCDViewAction : uint8_t { ^~~~~ In file included from Marlin\src\lcd\dogm../menu/menu.h:24:0, from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293: Marlin\src\lcd\dogm../menu/../marlinui.h:82:134: warning: default argument given for parameter 5 of 'void _wrap_string(uint8_t&, uint8_t&, const char, read_byte_cb_t, bool)' [-fpermissive] void _wrap_string(uint8_t &col, uint8_t &row, const char const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false); ^ In file included from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:52:0: Marlin\src\lcd\dogm../ultralcd.h:83:10: note: previous specification in 'void _wrap_string(uint8_t&, uint8_t&, const char, read_byte_cb_t, bool)' here void _wrap_string(uint8_t &col, uint8_t &row, const char const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false); ^~~~ In file included from Marlin\src\lcd\dogm../menu/menu.h:24:0, from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293: Marlin\src\lcd\dogm../menu/../marlinui.h: In function 'void wrap_string_P(uint8_t&, uint8_t&, const char, bool)': Marlin\src\lcd\dogm../menu/../marlinui.h:83:19: error: redefinition of 'void wrap_string_P(uint8_t&, uint8_t&, const char, bool)' inline void wrap_string_P(uint8_t &col, uint8_t &row, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(col, row, pstr, read_byte_rom, wordwrap); } ^~~~~ In file included from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:52:0: Marlin\src\lcd\dogm../ultralcd.h:84:17: note: 'void wrap_string_P(uint8_t&, uint8_t&, const char, bool)' previously defined here inline void wrap_string_P(uint8_t &col, uint8_t &row, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(col, row, pstr, read_byte_rom, wordwrap); } ^~~~~ In file included from Marlin\src\lcd\dogm../menu/menu.h:24:0, from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293: Marlin\src\lcd\dogm../menu/../marlinui.h: In function 'void wrap_string(uint8_t&, uint8_t&, const char, bool)': Marlin\src\lcd\dogm../menu/../marlinui.h:84:19: error: redefinition of 'void wrap_string(uint8_t&, uint8_t&, const char, bool)' inline void wrap_string(uint8_t &col, uint8_t &row, const char const string, const bool wordwrap=false) { _wrap_string(col, row, string, read_byte_ram, wordwrap); } ^~~ In file included from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:52:0: Marlin\src\lcd\dogm../ultralcd.h:85:17: note: 'void wrap_string(uint8_t&, uint8_t&, const char, bool)' previously defined here inline void wrap_string(uint8_t &col, uint8_t &row, const char const string, const bool wordwrap=false) { _wrap_string(col, row, string, read_byte_ram, wordwrap); } ^~~ In file included from Marlin\src\lcd\dogm../menu/menu.h:24:0, from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293: Marlin\src\lcd\dogm../menu/../marlinui.h: At global scope: Marlin\src\lcd\dogm../menu/../marlinui.h:95:8: error: multiple definition of 'enum MarlinFont' enum MarlinFont : uint8_t { ^~~~~~ In file included from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:52:0: Marlin\src\lcd\dogm../ultralcd.h:235:8: note: previous definition here enum MarlinFont : uint8_t { ^~~~~~ In file included from Marlin\src\lcd\dogm../menu/menu.h:24:0, from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293: Marlin\src\lcd\dogm../menu/../marlinui.h:119:5: error: conflicting declaration 'typedef struct preheat_t preheat_t' } preheat_t; ^~~~~ In file included from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:52:0: Marlin\src\lcd\dogm../ultralcd.h:253:5: note: previous declaration as 'typedef struct preheat_t preheat_t' } preheat_t; ^~~~~ compilation terminated due to -fmax-errors=5. *** [.pio\build\mega2560ext\src\src\lcd\dogm\ultralcd_DOGM.cpp.o] Error 1 ============================================================================== [FAILED] Took 88.88 seconds ==============================================================================

Environment Status Duration


mega2560ext FAILED 00:01:28.878 ========================================================================= 1 failed, 0 succeeded in 00:01:28.878 ========================================================================= The terminal process "C:\Users\Derrick Smith.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Steps to Reproduce

  1. Goto the Configurations and copy the Wanhao D6 example profile over the stock configs downloaded from the latest Bugfix release. https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.0.x/config/examples/Wanhao/Duplicator%206
  2. Open VSCODE and open the project and Build it.
  3. Look at the errors.

Version of Marlin Firmware

CONFIGURATION_H_VERSION 020008

Printer model

Wanhao/Duplicator 6

Electronics

No response

Add-ons

No response

Your Slicer

No response

Host Software

No response

thisiskeithb commented 3 years ago

I used Github Desktop and downloaded Gary Chen's original D6 configuration files. https://github.com/garychen99/Duplicator-6-firmware-version-3.1

We cannot support forks here.

Deneteus commented 3 years ago

@thisiskeithb This is not a port. You didn't even read the issue thoroughly. What I was trying to do was copy over the config settings to the current Marlin bugfix configuration files and then compile and when that didn't work I tested the Bugfix with the Example config and it failed as well so I know it wasn't my fault because the Example config doesn't work.

ellensp commented 3 years ago

Config url you provided. https://github.com/MarlinFirmware/Configurations/tree/import-2.0.x/config/examples/Wanhao/Duplicator%206 This is the import branch.

Readme for the Configurations.

NB If you are downloading these configuration files in a zip file from the CODE button, you first must select 
the branch that matches the version of Marlin you are compiling.

Branches
Release: For most Marlin users. Select the version that matches the Marlin version you are compiling.

Bugfix: For users compiling the bugfix branch of Marlin.

Import: For developers maintaining the Configuration examples.

for bugfix code you need to use bugfix branch https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.0.x/config/examples/Wanhao/Duplicator%206

This compiles without out any issues.

Deneteus commented 3 years ago

I did and it did not compile without issues.

Deneteus commented 3 years ago

Steps to Reproduce Goto the Configurations and copy the Wanhao D6 example profile over the stock configs downloaded from the latest Bugfix release. https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.0.x/config/examples/Wanhao/Duplicator%206 Open VSCODE and open the project and Build it. Look at the errors.

Deneteus commented 3 years ago

Why even ask for documentation if you aren't going to read it.

I did not say I used that branch to build it. I said I copied over the configuration settings to the current branch.

Deneteus commented 3 years ago

What version does this say? image

image

ellensp commented 3 years ago

stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch! stop using import branch!

Deneteus commented 3 years ago

I wasn't using import branch I just copied the wrong link. image

ellensp commented 3 years ago

They your doing something wrong.
latest bugfix + https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.0.x/config/examples/Wanhao/Duplicator%206 no modifications.

compiles without issues.

My guess is you extracted bugfix code over marlin release code And you now have a mix of both lots of code Since many files changed names. this results in many redefinition errors.

Delete you copy of marlin. Start again

Deneteus commented 3 years ago

Just for you I wiped the repository and re-downloaded it. image

Copied over these configs.

image

Into the current version of Marlin Bugfix.

image

Gives this error.

image

Manual update the Platformio.ini with the correct board. image

Fails to compile when it reaches the LCD section.

image

ellensp commented 3 years ago

from your first image, still import branch

import

Deneteus commented 3 years ago

Yeah I caught that after I posted it. I am re-wiping out everything again. I had already done this before like 6 times.

image

Deneteus commented 3 years ago

image

Deneteus commented 3 years ago

When you wipe it out and reload it the window defaults to import branch,

image

thisiskeithb commented 3 years ago

For best results getting help with configuration and troubleshooting, please use the following resources:

Deneteus commented 3 years ago

Now it's the correct branch in the dropdown.

image

image

image

@thisiskeithb Could you stop being patronizing for one second. I am in those groups and the forum.

image

image

This is what happens.

image

ellensp commented 3 years ago

so now you have bugfix config files and marlin 2.0.x code... still miss matched....

Deneteus commented 3 years ago

I looked at the window the other workspace was still open. Just closed it and re-ran it.

image

I am going to manually download the files instead of using github and retest it.

thisiskeithb commented 3 years ago

I am in those groups and the forum.

Please use them. This is not what the issue queue is for.

Deneteus commented 3 years ago

image

Executing task in folder Marlin: C:\Users\Derrick Smith.platformio\penv\Scripts\platformio.exe run <

Processing mega2560 (platform: atmelavr; board: megaatmega2560; framework: arduino)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/megaatmega2560.html PLATFORM: Atmel AVR (3.2.0) > Arduino Mega or Mega 2560 ATmega2560 (Mega 2560) HARDWARE: ATMEGA2560 16MHz, 8KB RAM, 248KB Flash DEBUG: Current (avr-stub) On-board (avr-stub, simavr) PACKAGES:

Environment Status Duration


mega2560 FAILED 00:01:34.322 ========================================================================= 1 failed, 0 succeeded in 00:01:34.322 ========================================================================= The terminal process "C:\Users\Derrick Smith.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

ellensp commented 3 years ago

you have selected 2.0.x branch of marlin code 2 0 x

not bugfix.

You MUST match your version of config with the code

bugfix configs, with bugfix code release 2.0.7.2 configs with 2.0.x code (current release)

rhapsodyv commented 3 years ago

"ultralcd.h" doesn't exist anymore. It's a build issue. You have old and new files mixed in the same folder.

You should ask for help on one of Malin groups/forums: