Welcome! Log In Create A New Profile

Advanced

ENDER 3 V2 SKR 1.4 TURBO compilation issues

Posted by Chwal 
ENDER 3 V2 SKR 1.4 TURBO compilation issues
January 15, 2021 10:02AM
Hello there,

I am trying to implement dual extrusion 1 Nozzle on my Ender 3 V2.

For the moment I am just trying to get the screen to work properly ...

I try to compile latest marlin repo (bug fix V2), load the config file (also bugfix 2.x)

I edit the board and serial ports only as the LCD is properly setup :



Then the compilation succeeds but some highlights due to some dwin.cpp which I believe is the screen config ?

Please see below the capture of my compilation log :



I loaded the .bin file on the microSD card, plugged it in my printer and turned it on but the screen remains blank :



Someone has an idea ? is it a bug ?

I still need to setup the 2nd extruder and the BLTOUCH to have a working printer but it's not easy without a display ...
Attachments:
open | download - Configuration.h (93.9 KB)
open | download - Configuration_adv.h (148.1 KB)
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
January 15, 2021 08:33PM
That display is a serial device.

There are no serial port on that plug of the skr 1.4, you cannot simply just plug it into exp1, it is not designed for this type of display

these are the serial port on this controller from [github.com]

Serial TX RX FUNCNUM
Default P0_02 P0_03 1

Serial1 TX RX FUNCNUM
Default P0_15 P0_16 1
LPC_PINCFG_UART1_P2_00 P2_00 P2_01 2

Serial2 TX RX FUNCNUM
Default P0_10 P0_11 1
LPC_PINCFG_UART2_P2_08 P2_08 P2_09 2

Serial3 TX RX FUNCNUM
Default P0_00 P0_01 2
LPC_PINCFG_UART3_P0_25 P0_25 P0_26 3
LPC_PINCFG_UART3_P4_28 P4_28 P4_29 3


the default serial port for this LCD in marlin is serial 3 , the skr 1.4 pins files also has LPC_PINCFG_UART3_P4_28 set so the default is pins P4_28 P4_29 (on the wifi connector)
the code is
#if ENABLED(DWIN_CREALITY_LCD)
  #define SERIAL_CATCHALL 0
  #ifndef LCD_SERIAL_PORT
    #define LCD_SERIAL_PORT 3

LCD_SERIAL_PORT is not defined so is set here at 3

You going to have to make up a break out cable to move the serial lines to a actual serial port pins

Edited 5 time(s). Last edit at 01/16/2021 03:16AM by Dust.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
January 15, 2021 10:18PM
The warnings are a concern.

The variable is a char ie 0-255 but the case is looking for negative numbers as well.

The fix is in dwin.h

I have created a PR to fix this [github.com]

Only 1 warning remains,

Marlin/src/lcd/dwin/e3v2/dwin.cpp:500:71: warning: use of 'auto' in parameter declaration only available with '-fconcepts'
  500 | inline bool Apply_Encoder(const ENCODER_DiffState &encoder_diffState, auto &valref) {

Edited 2 time(s). Last edit at 01/15/2021 11:17PM by Dust.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
January 16, 2021 01:58AM
Latest bugfix now has the Above PR merged
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
January 16, 2021 04:19AM
Hi Dust,

Thanks for the detailed reply ! Even if I am quite new to this, I understand it partially.

Now I need to decide if I'm better off with making a custom cable (with the very little knowledge that I have) or buying a compatible screen, or change the board ...

If decided to tweak the cable, what would you keep from initial EXP1 connector ?

 *          Ender 3 V2 display                              SKR 1.4 TURBO EXP1            SKR 1.4 TURBO WIFI
 *                _____                                           _____                          _____
 *            5V | 1 2 | GND                                  5V | 1 2 | GND               4.28 | 1 2 | 3.3V
 *   (BTN_E1) A  | 3 4 | B (BTN_E2)                         1.23 | 3 4 | 1.22                NC | 3 4 | NC
 *          BEEP | 5 6   ENT (BTN_ENC)                      1.21 | 5 6   1.20                NC | 5 6 | NC
 *            TX | 7 8 | RX                                 1.19 | 7 8 | 1.18               GND | 7 8 | 4.29
 *            NC | 9 10| NC                                 0.28 | 9 10| 1.30                    -----     
 *                -----                                           -----                          
 *                EXP1

Could you help me with the wiring ?

once wired, what are the changes needed to Marlin ?

Only configuring second serial port as 3 ? or should I change also the pin address somewhere ?

I have 2 serial ports to configure on the board and I thought I needed both as follow :


Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
January 16, 2021 04:50AM
You don't need serial_port_2, that is for things that talk or understand gcode. This lcd does not.

add #define LCD_SERIAL_PORT {and the serial port number you wish to use. 0-3) for the LCD

You need to keep pins 1-6 on the exp1 connected, this is for power, encoder and the beeper.

You need to get pins 7 and 8 from the lcd onto the serial port your using.

"once wired, what are the changes needed to Marlin"
Unknown, will cross those bridges as needed. Looks to be minimal

Surprisingly the skr 1.4 pins files does knows about this LCD and looks correct. For encoder and beeper
So I suspect someone somewhere has this working already

Edited 1 time(s). Last edit at 01/16/2021 04:53AM by Dust.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
January 16, 2021 07:41AM
OK thanks again,

I confirm compilation works now much better.

I don't need the wifi as I have an astrobox ready to link with the printer to handle the communications.

If I understand everything correct :

#if ENABLED(DWIN_CREALITY_LCD)
  #define SERIAL_CATCHALL 0
  #ifndef LCD_SERIAL_PORT
    #define LCD_SERIAL_PORT 3

The code is defining LCD_SERIAL_PORT 3



which can be linked with pin 4.28 and 4.29 for serial communication.

How can I switch from the default to 4.28 and 4.29 ?

Do you think this wiring is correct and won't fry components ?



Edited 1 time(s). Last edit at 01/16/2021 07:41AM by Chwal.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
January 16, 2021 08:06AM
Yes all looking good.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
January 16, 2021 08:43AM
Ok, here is the cable prepared and plugged :





I added this command the the Conditionals_LCD.h in order to activate the 4.28 and 4.29 :

#if ENABLED(DWIN_CREALITY_LCD)
  #define SERIAL_CATCHALL 0
  #ifndef LCD_SERIAL_PORT
    #define LCD_SERIAL_PORT 3 // Creality 4.x board
    #define LPC_PINCFG_UART3_P4_28 // RX/TX from WIFI port on SKR 1.4 TURBO
  #endif
#endif

Now compiling and testing ... all fingers are crossed eye popping smiley

EDIT :

IT WORKS !!



Thanks so much DUST for your good hints and support !!! smileys with beer

I am now unstuck !!

Still remains to setup BLTOUCH and dual extrusion with single nozzle, but feels GOOD ! smiling bouncing smiley

Edited 1 time(s). Last edit at 01/16/2021 08:51AM by Chwal.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
January 16, 2021 05:31PM
Nice.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
April 26, 2021 11:30PM
I have one of these I would like to get working with a SKR 1.4 using the same wifi pins. I see where you used #define LPC_PINCFG_UART3_P4_28 which I assume is P4.28 but I don't see where you used P4_29?

Right now I have the red and orange wire cut from the EXP1 plug with connectors added and the rest of EXP1 wires plugged into the EXP1 socket on the board. It's my assumption/understanding that I only have to change the two wires to the two pins 4.28 and 4.29 then edit conditionals_lcd.h as you did. It also looks like I need to add:

#define LCD_SERIAL_PORT 3

To my configuration.h?
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
April 26, 2021 11:33PM
Forgot to mention I have "#define DWIN_CREALITY_LCD" enabled in configuration.h as well.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
April 27, 2021 02:14AM
Hi,

To answer your first question, have a look at the table above with serial 3. The def uart 3 P4 is activating both 28 and 29.

Maybe recheck you routing ?

I’m not home but I’ll check when I come back in 2 weeks and let you know if I find more advice.

Wishing you a nice day !
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
April 28, 2021 07:19PM
Quote
Chwal
Hi,

To answer your first question, have a look at the table above with serial 3. The def uart 3 P4 is activating both 28 and 29.

Maybe recheck you routing ?

I’m not home but I’ll check when I come back in 2 weeks and let you know if I find more advice.

Wishing you a nice day !

Thanks for the reply. I think I understand, it's automatically using the next pin for tx/rx. So far I haven't found conditionals_lcd.h only some dwin & rotary related stuff so I'm thinking you are editing a version previous to marlin 2.0? I only have experience with 2.0. I have done some object base win programming but that was years ago and I have no micro controller experience besides editing config header files.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
April 28, 2021 07:42PM
This is all Marlin 2 bugfix

LCD_SERIAL_PORT was added quite recently.

Marlin/src/inc/Conditionals_LCD.h

Edited 1 time(s). Last edit at 04/28/2021 07:48PM by Dust.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
April 29, 2021 12:33AM
Thanks I found it in src/HAL/AVR/inc. I also found another guy who was able to use the TFT serial RX/TX and it looks like there are some files being included in the latest updates so I think eventually we will see EXP1 used for encoder/beep and the display serial for data transfer enabled by default for DWIN displays. I just downloaded the latest nightly Marlin to see what all has been merged for this lately and I'll report back.

Edit: Just saw your edit showing it's in src/inc. I see:


#if ENABLED(DWIN_CREALITY_LCD)
#define SERIAL_CATCHALL 0
#endif

So I'll try adding the code Chwal mentioned and see how it goes. Thanks again.

Edited 1 time(s). Last edit at 04/29/2021 05:09AM by ChrisT88.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
May 24, 2021 03:12PM
Quote
Dust
The warnings are a concern.

The variable is a char ie 0-255 but the case is looking for negative numbers as well.

The fix is in dwin.h

I have created a PR to fix this [github.com]

Only 1 warning remains,

Marlin/src/lcd/dwin/e3v2/dwin.cpp:500:71: warning: use of 'auto' in parameter declaration only available with '-fconcepts'
  500 | inline bool Apply_Encoder(const ENCODER_DiffState &encoder_diffState, auto &valref) {


Thanks for this, was an easy fix. I can currently compile my code if I disable eeprom settings in configuration.h and the screen works, scrolls and selects but some menus are missing, I'm guessing due to a lack of eeprom. With eeprom settings enabled I get this error included in the photo.

Appreciate any input,
Chris
Attachments:
open | download - error.jpg (929 KB)
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
May 24, 2021 04:25PM
False alarm guys, I got it figured out. Found some code that looked updated vs mine so I edited line 218 and 227 with: #if BOTH(EEPROM_SETTINGS, IIC_BL24CXX_EEPROM)

EEPROM is enabled now and the encoder and button seem to function fine, all menus are visible as well.


Thanks again guys.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
June 11, 2021 06:45PM
Hello Members!

As a result of the modifications, the factory display of Ender 3V2 uses RX0/TX0 pins, placed on the TFT
port (Not the WiFi port) of the motherboard, for communication.
It is important to note, that the published settings are not complete Marlin settings!
These modifications are intended to make the display work from the TFT port!
Regardless, the parameters of the machine must be set in the Marlin Firmware!

Tested with Marlin 2.0.8.2 latest FW

I do not take any responsibility for the settings, nor for any damage due to wiring errors!

Here is my solution for the original Ender 3 V2 screen to SKR 1.4(Turbo) issue:

platformio.ini

Step1: Search: default_envs
Step2: default_envs = LPC1769 // Change the processor type


Configuration.h

Step1: Search: SERIAL_PORT
Step2: #define SERIAL_PORT -1 // Set 0 to 1
Step3: Search: MOTHERBOARD
Step4: #define MOTHERBOARD BOARD_BTT_SKR_V1_4_TURBO // Change the board type
Step5: Search: DWIN_CREALITY_LCD
Step6: #define DWIN_CREALITY_LCD // Uncomment the line


Configuration_adv.h

Step1: Search: ENCODER_10X_STEPS_PER_SEC
Step2: Replace the lines to this, or add the specified line
#if ENABLED(ENCODER_RATE_MULTIPLIER)
#define ENCODER_5X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 5x speed
// Add this line before 10X
#define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed
#define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed
#endif
Step3: Search: CHOPPER_TIMING CHOPPER_DEFAULT_
Step4: #define CHOPPER_TIMING CHOPPER_DEFAULT_24V // Change the 12V to 24V


Conditionals_LCD.h

Step1: Search: DWIN_CREALITY_LCD
Step2: Replace the lines to this, or modify the variable
#if ENABLED(DWIN_CREALITY_LCD)
#define SERIAL_CATCHALL 0
#ifndef LCD_SERIAL_PORT
#define LCD_SERIAL_PORT 0 // Change the port // SKR 1.4 board
#endif
#endif


pins_BTT_SKR_V1_4.h

Step1: Search: BOARD_CUSTOM_BUILD_FLAGS
Step2: Replace the lines to this, or modify the variable
BOARD_CUSTOM_BUILD_FLAGS
#ifndef BOARD_CUSTOM_BUILD_FLAGS
#define BOARD_CUSTOM_BUILD_FLAGS -DLPC_PINCFG_UART3_P0_2 //Change the P4_28 to P0_2
#endif





Thingiverse link: https://www.thingiverse.com/thing:4883707

Edited 1 time(s). Last edit at 06/11/2021 06:48PM by CREationMZ.
Attachments:
open | download - 5.jpg (238 KB)
open | download - howto2.jpg (315.6 KB)
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
June 14, 2021 08:13PM
Hello.
Anyone know how to get work ender 3 v2 dwin display with a btt e3 turbo (Lpc1769)

I dont know how to use the RX & TX pin from tft port.

I can add
#define BOARD_CUSTOM_BUILD_FLAGS -DLPC_PINCFG_UART3_P0_2
?
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
June 14, 2021 10:15PM
@TomE911

why use the tft port at all.

P0_15 and P0_16 on exp1 are serial port 1, why not use that? you just need to change

#if HAS_DGUS_LCD
  #define LCD_SERIAL_PORT 3

to LCD_SERIAL_PORT 1

and make up a special cable.


The tft port is serial 0, not serial 3. Serial port 0 cannot have any pin changes.

If you want to use the tft port just set LCD_SERIAL_PORT 0

LPC_PINCFG_UART3_P0_2 is not valid.
See [github.com] (scroll down) for valid options

Edited 1 time(s). Last edit at 06/14/2021 10:16PM by Dust.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
June 15, 2021 01:16AM
@Dust

I didn't know that P0_15 and P0_16 are serial pins.
why do I have to change the lcd serial port at
#if HAS_DGUS_LCD?
I use creality dwin

Then i build my special cable.
Change some pin like:
#if ENABLED(DWIN_CREALITY_LCD)

#ifndef BEEPER_PIN
#define BEEPER_PIN               EXP1_10_PIN
#undef SPEAKER
#endif

#define BTN_EN1                  EXP1_03_PIN
#define BTN_EN2                  EXP1_04_PIN
#define BTN_ENC                  EXP1_06_PIN


#endif


And ender 3 v2 display will work?

Edited 1 time(s). Last edit at 06/15/2021 01:17AM by TomE911.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
June 15, 2021 05:21AM
"why do I have to change the lcd serial port at
#if HAS_DGUS_LCD?
I use creality dwin"

read the comment above HAS_DGUS_LCD in Configuration_adv.h
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
June 18, 2021 02:24PM
Quote
Dust
"why do I have to change the lcd serial port at
#if HAS_DGUS_LCD?
I use creality dwin"

read the comment above HAS_DGUS_LCD in Configuration_adv.h


Thanks it works so far.
but i have change in

Conditionals_LCD.h
#define LCD_SERIAL_PORT 1


#if HAS_DGUS_LCD has not worked because it is not enabled in config.



Edited 1 time(s). Last edit at 06/18/2021 02:27PM by TomE911.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
June 22, 2021 03:30PM
Hello there,

i also have an Ender 3 V2 and want to install the SKR E3 Turbo. I did all the changes mentioned above and building the .bin file was successful so far.
After flashing it to the SKR E3 Turbo the display makes a a loud continuous tone. Can someone help me out? Until now I have connected the display to the mainboard without any changes. Do I have to make a special cable for this?

Thank you all in advance!
Rick
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
June 22, 2021 09:36PM
Yes you need a special cable. Something like this.


 *          Ender 3 V2 display                               SKR E3 Turbo EXP1         
 *                _____                                           _____                         
 *            5V | 1 2 | GND                                  5V | 1 2 | GND               
 *   (BTN_E1) A  | 3 4 | B (BTN_E2)                BTN_EN1  0.18 | 3 4 | 0.17  BTN_EN2               
 *          BEEP | 5 6   ENT (BTN_ENC)                  TX  0.15 | 5 6   0.20  BTN_ENC       
 *            TX | 7 8 | RX                                 RST  | 7 8 | 0.19             
 *            NC | 9 10| NC                             RX  0.16 | 9 10| 2.08  BEEPER_PIN               
 *                -----                                           -----                          
 *                EXP1

Edited 8 time(s). Last edit at 06/22/2021 09:43PM by Dust.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
June 24, 2021 12:14PM
Thank you! Now my display works smiling smiley
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
October 12, 2021 08:29AM
Hi Guys


Any chance of helping me get a e3v2 screen working with a skr 2?
I assume i can use the tft port for rx/tx im just not sure how to set up the port.

Thanks' for any help in advance Dave
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
November 28, 2021 12:10PM
Can you send the bin file for the skr e3 turbo please? Also if possible a photo with the custom cable, as the scheme above is a bit confusing

Edited 1 time(s). Last edit at 11/28/2021 12:10PM by justGuner.
Re: ENDER 3 V2 SKR 1.4 TURBO compilation issues
November 28, 2021 01:57PM
Quote
womit
Hi Guys


Any chance of helping me get a e3v2 screen working with a skr 2?
I assume i can use the tft port for rx/tx im just not sure how to set up the port.

Thanks' for any help in advance Dave

Good question
It is a STM32 Cpu
Anyone know how so set TX/RX pin for STM32 ?

I found
TX = PD8
RX = PD9

Its on wifi port.
Dont know it help


[stm32f4-discovery.net]
Looks you have to choose Usart

Edited 3 time(s). Last edit at 11/28/2021 02:35PM by TomE911.
Sorry, only registered users may post in this forum.

Click here to login