Skip to content

mike391/Marlin-Labists-ET4

 
 

Repository files navigation

Marlin for Labists ET4 3D printers

This project is a fork from davidtgbe effort to try to adapt the Anet ET4/ET5 motherboard and display for use with Marlin. I've made only config changes to make it work with Labists implementation of the ET4 and as such all credit should go to davidtgbe.

Current status

Working:

  • XYZ Steppers
  • Extruder
  • SD Card
  • USB comunication / pronterface
  • TFT
  • Filament runout detector.
  • EEPROM
  • Powerloss. See issues tab.

On progress:

  • PC/SD firmware load/update: I've managed to get working OpenBLT, (PC-USB / SD / DFU) updates. I'm still looking for a way to do a first time flash without flasher. Even so, a hardware flasher is very recommended for its price.

To take a look:

  • All files on path "Marlin\buildroot\share\PlatformIO\variants\ET4" should be adapted to ET4/5 Board. Specially peripheralPins.c, variant.cpp, variant.h etc..

Known bugs:

I have enabled issues tab. Please, try to be detailed regarding use cases and other useful information like hardware and software context. To get help on creating an issue see this.

BUILD/INSTALLATION

DISCLAIMER: Not for production use. This is an unfinished project and under development. I am not responsible for what may happen to the motherboard or printer. Use only at your own risk.

Currently you can only flash this firmware using a flasher (stlink, jlink, bmp etc), unless you already have flashed the openblt bootloader (BL).

Before flashing this firmware (optional, but recommended):

First time, I recommend making a backup of your firmware. At least your bootlaoder (addresses from 0x08000000 to 0x08010000). This way, you can always recover/return to stock firmware by:

  1. flashing the bootloader backup, from address 0x08000000 to 0x8010000.
  2. flashing any of the available firmwares from address 0x08010000 onwards.

Keep in mind that my origina firmware backup didn't restore properly. The Firmware images are for the Anet ET models provided by davidtgbe

Considerations

You have two options to install/update this firmware:

  • Option A > Not using a bootloader (BL)
    • Firmware (Marlin) starts directly when you switch on the printer.
    • You need the flasher to perform firmware installation/updates.
  • Option B > Using a bootloader along with this firmware
    • When you switch on the printer, bootloader (BL) starts first, and, if there are not any firmware updates incomming (on SD or through PC-USB), it loads the firmware (Marlin).
    • You need the flasher to flash the BL the first time. Once it is flashed, you MUST install/update your FW through your BL, either by SD card or USB-PC. You MUST NOT use the flasher to install/update the FW, as it will not work.

Step One: Building from sources

  1. Download or clone this repo. Ensure you build the firmware with latest sources, as firmware.srec file will not be built with older sources.

  2. Changes are already made to config.h and config_adv.h according to Labists ET4 model

  • Fine tunning could be needed (e.g. XYZE steps or offsets, Jerks, JD, LA, etc).
  1. If you are going to take option B from considerations section (using a BL), you can skip this step. Otherwise, you need to offset the firmware back to 0x08000000. That is achieved by commenting a line in platform.ini file. It is uncommented by default:
#
# Anet ET4
#
[env:ET4]
...
...
# Uncomment next line to build for use with bootloader. Offset depends on BL used.
board_build.offset  = 0x10000
...
...

Change "board_build.offset = 0x10000" to

#board_build.offset = 0x10000
  1. Build project with platform.io on VS code is recommended. There are many tutorials on the web. You can follow them, ADAPTING steps to build this project. This one here in spanish made by davidtgbe, and just another one here.
  2. If everything went well, you will find binary files firmware.[elf|bin|srec], generated in the build output folder:
<src_code_base_folder>\.pio\build\ET4\

Step two Flashing/Installing the firmware

There are several tutorials available for stlink/j-link flashers. Take a look to them.

You have two options to install/update this firmware:

  • Option A > If you are going to use the firmware without bootloader:
    • It is assumed you have built your firmware with no offset (followed step 1.3) .
    • As the firmware has been built without offset, and lacks of a bootloader, you have to just flash your firmware binary file (step 1.5) with your preferred flasher from address 0x8000000.
  • Option B > If you are going to use the firmware with bootloader:
    • You need to flash the bootloader from address 0x08000000. This step needs to be performed just once, so, you can skip this step if you have already done so. You can download the precompiled bootloader binary, or, you can build it yourself from source code using STM32 Cube IDE.
    • After flashing the BL, you can disconnect your flasher, it will not be used anymore.
    • Now it is time to install de firmware. BL will assist us in this task, so, you must use a SD-CARD OR USB-PC/microboot to flash perform this step.
      • SD-CARD -> Copy file firmware.srec from build folder (step 1.5) in the root folder of the SD-CARD.
      • USB-PC/microboot ->
        • Download microboot software. It is uploaded to github and you can download it from here.
        • Extract the .zip file you have just downloaded and browse to the folder openblt/Host/. You will find the microboot.exe executable.
        • Connect your printer via USB to your PC and get the COM port number.
        • Open microboot.exe executable and configure COM port number and speed (115200) through settings button. Then, click browse and search for the file firmware.srec. You will find it in the output build folder (step 1.5).
    • Switch off and then switch on the printer to begin the installation/update process.
    • Screen will be white during the process, and, after 3 or 4 minutes, Marlin will appear on the screen.

You can connect with pronterface to corresponding COM port @115200bps.

Flashing considerations

If you use bootloader, you must not use the flasher to install/update the FW. The bootloader inserts a special checksum in the firmware during the install/update process. Bootloader checks for this checksum before jumping to the firmware. If you use your flasher to install the firmware, this checksum is not written, and, therefore, bootloader will not boot the firmware, and your screen will be white.

*White screen usually means, printer is on bootloader mode, waiting for incoming installation/update.

DFU mode (Device Firmware Upgrade) has been added to the bootloader. You can enter to it just by pressing touchscreen while switching printer on. By using DFU mode you can even update your bootloader without needing a hardware flasher, just using the PC-USB and the right tool.

More info:
SD-CARD update process
PC-USB update process

HARDWARE

MCU: STM32F407VGT6 ARM CORTEX M4
DRIVERS: TMC2208 (silent) / A4988 (noisy)
USB TO SERIAL CONVERTER: CH340G
SERIAL FLASH MEMORY: WINBOND W25Q128JVSQ (128M-bit)
EEPROM: AT24C04C (ATMLH744 04CM) 4 Kb
LCD ET4: ST7789 @ 320x240 | STP320240_0280E2T (40P/1,5): ST7789 (YT280S008) | ST7789V
LCD ET5: ST7796S @ 480x320
TOUCH: XPT2046
MOSFETS (BED/HOTEND): G90N04
CLK: JF8.000 (8MHZ MCU EXT CLK)
CLK: JF12.000 (12 MHZ USB-UART CLK)
SCHOTTKY DIODE: SS56
REGULATOR: AMS1117 3.3 DN811
MOSFET: 030N06
MOSFET: A19T
STEP DOWN DC CONVERTER: XL2596S -5.0E1 83296
VOLTAGE COMPARATOR: 293 STG9834 / LM293DT

PIN MAPPING

E-STEP => PB9
E-DIR => PB8
E-ENABLE => PE0

X-STEP => PB6
X-DIR => PB5
X-ENABLE => PB7

Y-STEP => PB3
Y-DIR => PD6
Y-ENABLE => PB4

Z-STEP => PA12
Z-DIR => PA11
Z-ENABLE => PA15

Y-LIMIT => PE12
X-LIMIT => PC13
Z-LIMIT => PE11

TEMP_BED => PA4
TEMP_EXB1 => PA1

END_FAN => PE1
LAY_FAN => PE3

END_CONTROL => PA0
BED_CONTROL => PE2

LV_DET => PC3
MAT_DET1 => PA2
POWER_LOSS_DET => PA8 (provided by ANET)

SDIO_D2 => PC10
SDIO_D3 => PC11
SDIO_CMD => PD2
SDIO_CLK => PC12
SDIO_D0 => PC8
SDIO_D1 => PC9
TF_DET => PD3

USB_USART1_TX => PA9
USB_USART1_RX => PA10

RESET_BTN => NRST (14)
LED_D2 => PD12

WINBOND_CS => PB12
WINBOND_DO => PB14
WINBOND_DI => PB15
WINBOND_CLK => PB13

EEPROM_A1 => GND
EEPROM_A2 => GND
EEPROM_SDA => PB11
EEPROM_SCL => PB10

P1_1_LCD_9_CSX => PD7
P1_2_LCD_11_WRX => PD5
P1_3_TOUCH_15_/CS => PB2
P1_4_TOUCH_14_DIN => PE5
P1_5_TOUCH_12_DOUT => PE4
P1_6_TOUCH_16_DCLK => PB0
P1_7_TOUCH_11_/PENIRQ => PB1
P1_8_LCD_12_RDX => PD4
P1_9 => GND
P1_10 => 3.3V

P2_1_LCD_15_RESX => PE6
P2_2_LCD_10_DCX => PD13
P2_3_LCD_26_DB9 => PD15
P2_4_LCD_25_DB8 => PD14
P2_5_LCD_28_DB11 => PD1
P2_6_LCD_27_DB10 => PD0
P2_7_LCD_30_DB13 => PE8
P2_8_LCD_29_DB12 => PE7
P2_9_LCD_32_DB15 => PE10
P2_10_LCD_31_DB14 => PE9

Resources

ET4 Telegram Spanish Group Resources
ET4 Board and specs

Acknowledgements

  • To the mates of the Telegram Anet ET4 spanish group, specially to @Solidnon, who lent his board for testing when the project was not even started.
  • To @uwe and @mubes from Black Magic Probe team, and to Ebiroll (BMP/ESP32).
  • To all contributors and testers of this branch and, specially, of Marlin master branch.

Marlin 3D Printer Firmware

GitHub GitHub contributors GitHub Release Date Build Status

Additional documentation can be found at the Marlin Home Page. Please test this firmware and let us know if it misbehaves in any way. Volunteers are standing by!

Marlin 2.0 Bugfix Branch

Not for production use. Use with caution!

Marlin 2.0 takes this popular RepRap firmware to the next level by adding support for much faster 32-bit and ARM-based boards while improving support for 8-bit AVR boards. Read about Marlin's decision to use a "Hardware Abstraction Layer" below.

This branch is for patches to the latest 2.0.x release version. Periodically this branch will form the basis for the next minor 2.0.x release.

Download earlier versions of Marlin on the Releases page.

Building Marlin 2.0

To build Marlin 2.0 you'll need Arduino IDE 1.8.8 or newer or PlatformIO. We've posted detailed instructions on Building Marlin with Arduino and Building Marlin with PlatformIO for ReArm (which applies well to other 32-bit boards).

Hardware Abstraction Layer (HAL)

Marlin 2.0 introduces a layer of abstraction so that all the existing high-level code can be built for 32-bit platforms while still retaining full 8-bit AVR compatibility. Retaining AVR compatibility and a single code-base is important to us, because we want to make sure that features and patches get as much testing and attention as possible, and that all platforms always benefit from the latest improvements.

Current HALs

AVR (8-bit)

board processor speed flash sram logic fpu
Arduino AVR ATmega, ATTiny, etc. 16-20MHz 64-256k 2-16k 5V no

DUE

boards processor speed flash sram logic fpu
Arduino Due, RAMPS-FD, etc. SAM3X8E ARM-Cortex M3 84MHz 512k 64+32k 3.3V no

ESP32

board processor speed flash sram logic fpu
ESP32 Tensilica Xtensa LX6 240MHz --- --- 3.3V ---

LPC1768 / LPC1769

boards processor speed flash sram logic fpu
Re-ARM LPC1768 ARM-Cortex M3 100MHz 512k 32+16+16k 3.3-5V no
MKS SBASE LPC1768 ARM-Cortex M3 100MHz 512k 32+16+16k 3.3-5V no
Selena Compact LPC1768 ARM-Cortex M3 100MHz 512k 32+16+16k 3.3-5V no
Azteeg X5 GT LPC1769 ARM-Cortex M3 120MHz 512k 32+16+16k 3.3-5V no
Smoothieboard LPC1769 ARM-Cortex M3 120MHz 512k 64k 3.3-5V no

SAMD51

boards processor speed flash sram logic fpu
Adafruit Grand Central M4 SAMD51P20A ARM-Cortex M4 120MHz 1M 256k 3.3V yes

STM32F1

boards processor speed flash sram logic fpu
Arduino STM32 STM32F1 ARM-Cortex M3 72MHz 256-512k 48-64k 3.3V no
Geeetech3D GTM32 STM32F1 ARM-Cortex M3 72MHz 256-512k 48-64k 3.3V no

STM32F4

boards processor speed flash sram logic fpu
STEVAL-3DP001V1 STM32F401VE Arm-Cortex M4 84MHz 512k 64+32k 3.3-5V yes

Teensy++ 2.0

boards processor speed flash sram logic fpu
Teensy++ 2.0 AT90USB1286 16MHz 128k 8k 5V no

Teensy 3.1 / 3.2

boards processor speed flash sram logic fpu
Teensy 3.2 MK20DX256VLH7 ARM-Cortex M4 72MHz 256k 32k 3.3V-5V yes

Teensy 3.5 / 3.6

boards processor speed flash sram logic fpu
Teensy 3.5 MK64FX512VMD12 ARM-Cortex M4 120MHz 512k 192k 3.3-5V yes
Teensy 3.6 MK66FX1M0VMD18 ARM-Cortex M4 180MHz 1M 256k 3.3V yes

Teensy 4.0 / 4.1

boards processor speed flash sram logic fpu
Teensy 4.0 IMXRT1062 ARM-Cortex M7 600MHz 1M 2M 3.3V yes
Teensy 4.1 IMXRT1062 ARM-Cortex M7 600MHz 1M 2M 3.3V yes

Submitting Patches

Proposed patches should be submitted as a Pull Request against the (bugfix-2.0.x) branch.

  • This branch is for fixing bugs and integrating any new features for the duration of the Marlin 2.0.x life-cycle.
  • Follow the Coding Standards to gain points with the maintainers.
  • Please submit your questions and concerns to the Issue Queue.

Credits

The current Marlin dev team consists of:

License

Marlin is published under the GPL license because we believe in open development. The GPL comes with both rights and obligations. Whether you use Marlin firmware as the driver for your open or closed-source product, you must keep Marlin open, and you must provide your compatible Marlin source code to end users upon request. The most straightforward way to comply with the Marlin license is to make a fork of Marlin on Github, perform your modifications, and direct users to your modified fork.

While we can't prevent the use of this code in products (3D printers, CNC, etc.) that are closed source or crippled by a patent, we would prefer that you choose another firmware or, better yet, make your own.

About

Marlin for Labists ET4 3D printers

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 68.4%
  • C 27.9%
  • Objective-C 2.1%
  • Python 0.7%
  • Shell 0.6%
  • Makefile 0.2%
  • Other 0.1%