Welcome! Log In Create A New Profile

Advanced

VSCode compilation issues of marlin 2.x bug fix

Posted by OrAnGeWorX 
VSCode compilation issues of marlin 2.x bug fix
April 08, 2021 01:16PM
Hello everyone,
I'm here because I was referred from the Marlin Github page because I am having a user-support issue and not a bug.
I won't dwell on this as it's a waist of time, energy and really not constructive (plenty of examples on there of actual user-support but hey, I'm not an all-knowledgeable mod)
To be honest, I'm not even sure what I'm asking. I had posted my tests here but haven't had any responses and on the Marlin issues page, well, it was closed.
I'm not a pro but not a beginner either so I can figure out my issues by myself and using the "search" but haven't yet found related issues.

I'll start with the most basic and take this a step at a time.
Printer: TronXY X5SA-Pro, bought end of 2020 but I believe it's the 2019 version.
Board: Chitu v6 32Bit
Firmware: Marlin 2.x Bug Fix
Compiler: VSCode
Config: built on the configuration for the X5SA found in the marlin examples archive (and how to)

I'm presently running a successful build of the firmware for which the configuration.h and configuration_adv.h have been lost (too many attempts at trying to figure out why I couldn't compile with #define TFT_LVGL_UI, should've thought of saving the working config. Doh!)
The only real change was setting the classic UI to the color UI
I've attempted and failed to build the firmware with the same options (as I've stated, it was built with changes that apply to the X5SA-Pro). And that started after I updated my marlin files from the git yesterday, with the only changes seeming to be added sanity checks.

I think this should be enough as a topic starter. Hopefully someone has some knowledge about this matter, I'm at a loss.

Thanks for taking the time
Re: VSCode compilation issues of marlin 2.x bug fix
April 08, 2021 01:51PM
Here's a follow up.
Started from scratch.
marlin 2.0 bug fix + new modified config files following the examples (also 2.0 bug fix)

I can no longer successfully compile the firmware... so weird
here's the log
Attachments:
open | download - failedCompilation.txt (5.7 KB)
Re: VSCode compilation issues of marlin 2.x bug fix
April 08, 2021 06:06PM
Here are my latest logs.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Marlin-bf2> platformio run -e chitu_f103
Processing chitu_f103 (platform: [email protected]~12.0; board: CHITU_F103; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: [docs.platformio.org]
PLATFORM: ST STM32 (12.0.0) > CHITU STM32F103Z (64k RAM. 512k Flash)
HARDWARE: STM32F103ZET6 72MHz, 59.12KB RAM, 469.03KB Flash
DEBUG: Current (blackmagic) External (blackmagic, jlink, stlink)
PACKAGES:
 - framework-arduinoststm32-maple 3.10000.201129 (1.0.0)
 - tool-stm32duino 1.0.2
 - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
Converting Marlin.ino
LDF: Library Dependency Finder -> [bit.ly]
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 28 compatible libraries
Scanning dependencies...
Dependency Graph
|--  1.0.0
|--  0.4.3
|   |--  1.0
|--  1.0
|-- 
|--  0.99
|--  1.0
|--  1.1.2
Building in release mode
Compiling .pio\build\chitu_f103\src\src\lcd\dogm\ultralcd_DOGM.cpp.o
Compiling .pio\build\chitu_f103\src\src\lcd\menu\menu_bed_corners.cpp.o
Compiling .pio\build\chitu_f103\src\src\lcd\menu\menu_bed_leveling.cpp.o
Compiling .pio\build\chitu_f103\src\src\lcd\menu\menu_configuration.cpp.o
Compiling .pio\build\chitu_f103\src\src\lcd\menu\menu_custom.cpp.o
Compiling .pio\build\chitu_f103\src\src\lcd\menu\menu_filament.cpp.o
Compiling .pio\build\chitu_f103\src\src\lcd\menu\menu_game.cpp.o
Compiling .pio\build\chitu_f103\src\src\lcd\menu\menu_main.cpp.o
In file included from c:\marlin-bf2\marlin\src\lcd\marlinui.h:28:0,
                 from Marlin\src\lcd\dogm\../menu/menu.h:24,
                 from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293:
c:\marlin-bf2\marlin\src\lcd\buttons.h:221:0: warning: "LCD_BACK_CLICKED" redefined
   #define LCD_BACK_CLICKED() (buttons & EN_D)
 
In file included from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:52:0:
Marlin\src\lcd\dogm\../ultralcd.h:223:0: note: this is the location of the previous definition
   #define LCD_BACK_CLICKED() false
 
In file included from Marlin\src\lcd\dogm\../menu/menu.h:24:0,
                 from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293:
c:\marlin-bf2\marlin\src\lcd\marlinui.h:79: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)
 
Compiling .pio\build\chitu_f103\src\src\lcd\menu\menu_media.cpp.o
Compiling .pio\build\chitu_f103\src\src\lcd\menu\menu_mixer.cpp.o
In file included from Marlin\src\lcd\dogm\../menu/menu.h:24:0,
                 from Marlin\src\lcd\dogm\ultralcd_DOGM.cpp:293:
c:\marlin-bf2\marlin\src\lcd\marlinui.h:67: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:
c:\marlin-bf2\marlin\src\lcd\marlinui.h:86:134: error: 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:
c:\marlin-bf2\marlin\src\lcd\marlinui.h: In function 'void wrap_string_P(uint8_t&, uint8_t&, const char*, bool)':
c:\marlin-bf2\marlin\src\lcd\marlinui.h:87: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:
c:\marlin-bf2\marlin\src\lcd\marlinui.h: In function 'void wrap_string(uint8_t&, uint8_t&, const char*, bool)':
c:\marlin-bf2\marlin\src\lcd\marlinui.h:88: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:
c:\marlin-bf2\marlin\src\lcd\marlinui.h: At global scope:
c:\marlin-bf2\marlin\src\lcd\marlinui.h:99: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 {
        ^~~~~~~~~~
compilation terminated due to -fmax-errors=5.
*** [.pio\build\chitu_f103\src\src\lcd\dogm\ultralcd_DOGM.cpp.o] Error 1
====================================================================================================== [FAILED] Took 20.56 seconds ======================================================================================================

Environment    Status    Duration
-------------  --------  ------------
chitu_f103     FAILED    00:00:20.564
================================================================================================= 1 failed, 0 succeeded in 00:00:20.564 =================================================================================================
Re: VSCode compilation issues of marlin 2.x bug fix
April 08, 2021 06:32PM
src\lcd\dogm\ultralcd_DOGM.cpp is not part of marlin bugfix, it is in older marlin versions.

src\lcd\marlinui.h is only in bugfix.

you have managed to extract marlin bugfix marlin over and older version of marlin and now you have an uncompilable tangle of old and new marlins.

Copy your configs files somewhere safe and delete marlin and re download it.
Re: VSCode compilation issues of marlin 2.x bug fix
April 08, 2021 09:15PM
that's so strange... could it be that I downloaded a non bug fix and dumped over a bugfix ?
Re: VSCode compilation issues of marlin 2.x bug fix
April 08, 2021 09:35PM
That would have the same result.

check in Marlin/src/inc/Version.h

2.0.7.2 says #define SHORT_BUILD_VERSION "2.0.7.2"
bugfix says #define SHORT_BUILD_VERSION "bugfix-2.0.x"

what ever you wrote last will still be there
Re: VSCode compilation issues of marlin 2.x bug fix
April 11, 2021 08:37AM
@Dust: thank you! Indeed it seems I have extracted the 2.0.7.2 over the 2.0.x BF... and that crapped everything.
I've cleared the files in my build folder, redownloaded BF and config, compiled the default and the modded config correctly.
But this brings me back to the initial post; successfully compiling with the TFT_LVGL_UI...
When I compile with TFT_COLOR_UI enabled, firmware build is ok.
when I compile with TFT_LVGL_UI enabled, it fails with message that FILAMENT_RUNOUT_SENSOR / ADVANCED_PAUSE_FEATURE need a compatible LCD.
that's weird given same options are enabled... I can't say what the difference between lvgl_ui and color_ui is but it's definitely strange that if it needs capable LCD for COLOR_UI and compiles without errors then it should be error free with LVGL_UI...

any ideas?
Re: VSCode compilation issues of marlin 2.x bug fix
May 02, 2021 11:55AM
I have a Anycubic Mega Zero 2.0. So far no Modds.
Means it has still the Melzi-Board with ATMega 1284P Processor and not removable A4988 Driver.
A while ago i Upgraded the Anycubic Default Firmware to TH3Ds Unified Firmware 2 from here [support.th3dstudio.com], no Problem what so ever.
Now i am sure TH3D cut the Marlin down to what is possible Size whise.

I tried to upgrade to Marlin 2.0.8 yesterday.
I downloaded Marlin 2.0.8 from here [marlinfw.org].
And the Configuration Files from here [github.com].
I used the release, import and bugfix Version of the Configuration Files.

I allready had installed and for figureing out why, i clean reainstalled VSCode from here [code.visualstudio.com].
I started and connected my Printer successfully to my Windows 10 Desktop Computer. No Issues with the USB Driver.

I followed the so often in youtube and at TH3D provided Steps for Upgrading Firmware. I did that successfully with my Geeetech A10T, which now has Marlin 2.0.8 release restored.

With my Anycubic Mega Zero 2.0 i get the following Error in VSCode/PlatformIO/Autobuild Marlin:

Processing mega2560 (platform: atmelavr; board: megaatmega2560; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
Error: Build environment 'mega2560' is incompatible with BOARD_MELZI_CREALITY. Use one of these: melzi_optiboot_optimized, melzi_optiboot, melzi_optimized, melzi
=============================================================================================== [FAILED] Took 0.64 seconds ===============================================================================================

Environment Status Duration
------------- -------- ------------
mega2560 FAILED 00:00:00.638
========================================================================================== 1 failed, 0 succeeded in 00:00:00.638 ==========================================================================================The terminal process "C:\Users\myusername\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.


It looks like PlatformIO Builds with a mega2560 Board, but in configuration.h it says #define BOARD_MELZI_CREALITY 1505 Melzi Creality3D (for CR-10 etc)

I think i am still doing something wrong, but i dont see what. I googled that Situation but i didnt find anything that makes sense to me.
Do i have to configure PlatformIO?
Is the Geeetech A10T in the Way? It is not connected to my Computer not even running while i am trying to Upgrade the Anycubic Mega Zero 2.0.
Do i have to unzip the Marlin File for every Version of Marlin 2.0.8?

Thank you in Advanced.
Attachments:
open | download - MarlinAnyCubicMegaZero2_0import.zip (81.2 KB)
open | download - MarlinAnyCubicMegaZero2_0bugfix.zip (81.2 KB)
open | download - MarlinAnyCubicMegaZero2_0release.zip (79.2 KB)
Re: VSCode compilation issues of marlin 2.x bug fix
May 02, 2021 12:15PM
PlatformIO Builds with with ever you set in the platfomio.ini file

the line default_envs = mega2560

you need to change it from mega2560 to one of the options listed melzi_optiboot_optimized, melzi_optiboot, melzi_optimized, melzi


If you use the Marlin auto builder, it does this for you [marlinfw.org]

Edited 1 time(s). Last edit at 05/02/2021 12:18PM by Dust.
Re: VSCode compilation issues of marlin 2.x bug fix
May 02, 2021 01:40PM
Thank you for the quick reply.
I tried Marlin Autobuild allready with the Marlin 2.0.8 import Version.
And it returned something about Size of the EEPROM or something. I will try again and add the Results here.
It also gave back 1 Error, but without Error Description. I will try to reproduce that aswell.
Re: VSCode compilation issues of marlin 2.x bug fix
May 03, 2021 04:21AM
You should not be using Import config files.

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.

You need to use release config files for release versions of marlin [github.com]
Re: VSCode compilation issues of marlin 2.x bug fix
May 15, 2021 08:55PM
I tried the Marlin Autobuilder with Marlin 2.0.8.1 release and Config/example/... 2.0.8.1.
I di no modification in config.h or of the three other Files.
I Build it with success. But i got an Error at Upload.
Error: Build environment 'mega2560' is incompatible with BOARD_MELZI_CREALITY. Use one of these: melzi_optiboot_optimized, melzi_optiboot, melzi_optimized, melzi
I choose in config.h Board_Melzi_Creality (that is the Default Setting from the Download), Melzi, Melzi_optimised, Sanguino 1284p_0ptimized and Sanguino 1284p.
I allways end in that Error.
Error: Build environment 'mega2560' is incompatible with BOARD_MELZI_CREALITY. Use one of these: melzi_optiboot_optimized, melzi_optiboot, melzi_optimized, melzi

I tried several new attemps to reinstall VSCode with removing all related Folders and Files. I downloaded Marlin and Configurations a couple of times.
I checked the USB Cable. Seems fine since the COM6 is recognised.

The Motherboard is a [www.anycubic.com]

Maybe i am still doing it wrong.
Re: VSCode compilation issues of marlin 2.x bug fix
May 15, 2021 09:23PM
I tried again.
This time it went a little different.
Again i didnt modify configuration.h or the other three.
I did not change the Board, so it is still #define MOTHERBOARD BOARD_MELZI_CREALITY.
I tried Melzi, did not make it through Building.
Melzi_Optimized, made it through Building but not through upload.
Melzi_Optiboot, did not make ti through Building and returned Error RAM: [=== ] 30.6% (used 5014 bytes from 16384 bytes)
Error: The program size (130920 bytes) is greater than maximum allowed (130048 bytes).
Melzi_Optimized_Optiboot made it though Building and Uploading. No Errors Returned.
No i will test some modification in configuration.h.
Attachments:
open | download - anycubicmegazero2_marlin2081.png (158.2 KB)
open | download - anycubicmegazero2_marlin2081_2.png (158.5 KB)
Re: VSCode compilation issues of marlin 2.x bug fix
May 16, 2021 01:56AM
melzi is obsolete and very much out of flash ram.

And yes you seem to be setting the build environment wrong.

You either use marlin auto build which sets the correct build environment from the GUI

Or you set default_envs = mega2560 platformio.ini to one of the listed options for your motherboard. ie melzi_optiboot_optimized, melzi_optiboot, melzi_optimized, melzi

note that Sanguino 1284p_0ptimized and Sanguino 1284p. is not listed. as these use a 4k bootloader which takes to much flash away from Marlin

Edited 2 time(s). Last edit at 05/16/2021 01:58AM by Dust.
Re: VSCode compilation issues of marlin 2.x bug fix
February 26, 2022 10:50AM
I have successfuly used marlin with vs code in the past on skr pro v1, skr 1:4 turbo and mks sgen l, now when I tried modifying the skr pro, I am getting serial faults in the hal file. I have marlin bugfix and marlin 2:0, should I dump those an start fresh?
Sorry, only registered users may post in this forum.

Click here to login