Skip to content
Chandra Tungathurthi edited this page May 6, 2021 · 15 revisions

How to flash

Flashing per-compiled release versions

  • The releases page contain the per-compiled firmware binaries marlin_*, these are ready to be flashed to the printer. The suffixes indicate the printer to which it belongs to -

There's already a handy script which downloads and flashes to the printer automatically

Flashing:

$ ./install_marlin.sh <machine>  --release-version <version>

...


# this will download and install the v0.7 firmware for dreamer nx.
# follow the instructions pointed in the script
$ ./install_marlin.sh dreamer_nx --release-version 0.8.1

You should see something similar --

[INFO]: Downloading FlashForge Marlin for dreamer_nx v0.8.1
[INFO]: Flashing FlashForge_Marlin/BUILD/marlin_dreamer_nx_v0.8.1.bin
Flashing firmware:  FlashForge_Marlin/BUILD/marlin_dreamer_nx_v0.8.1.bin
***********"
Ready to Flash Stock?:  False
***********"
Switch off your printer and connect to this computer via USB. When your are ready, press enter and switch on printer..
Searching for Flashforge printers ...
Found printer:

 DEVICE ID 0315:000a on Bus 020 Address 063 =================
 bLength                :   0x12 (18 bytes)
 bDescriptorType        :    0x1 Device
 bcdUSB                 :  0x200 USB 2.0
 bDeviceClass           :    0x0 Specified at interface
 bDeviceSubClass        :    0x0
 bDeviceProtocol        :    0x0
 bMaxPacketSize0        :   0x40 (64 bytes)
 idVendor               : 0x0315
 idProduct              : 0x000a
 bcdDevice              :  0x200 Device 2.0
 iManufacturer          :    0x1 Flashforge
 iProduct               :    0x2 FlashForge Dreamer NX 3D Printer
 iSerialNumber          :    0x3 00000000050C
 bNumConfigurations     :    0x1
  CONFIGURATION 1: 100 mA ==================================
   bLength              :    0x9 (9 bytes)
   bDescriptorType      :    0x2 Configuration
   wTotalLength         :   0x2e (46 bytes)
   bNumInterfaces       :    0x1
   bConfigurationValue  :    0x1
   iConfiguration       :    0x0
   bmAttributes         :   0xc0 Self Powered
   bMaxPower            :   0x32 (100 mA)
    INTERFACE 0: Vendor Specific ===========================
     bLength            :    0x9 (9 bytes)
     bDescriptorType    :    0x4 Interface
     bInterfaceNumber   :    0x0
     bAlternateSetting  :    0x0
     bNumEndpoints      :    0x4
     bInterfaceClass    :   0xff Vendor Specific
     bInterfaceSubClass :   0xff
     bInterfaceProtocol :   0xff
     iInterface         :    0x0
      ENDPOINT 0x1: Bulk OUT ===============================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :    0x1 OUT
       bmAttributes     :    0x2 Bulk
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x0
      ENDPOINT 0x81: Bulk IN ===============================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x2 Bulk
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x0
      ENDPOINT 0x83: Bulk IN ===============================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x83 IN
       bmAttributes     :    0x2 Bulk
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x0
      ENDPOINT 0x3: Bulk OUT ===============================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :    0x3 OUT
       bmAttributes     :    0x2 Bulk
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x0
Initiating control loop...
Starting control loop...
CMD M601 Received.
Control Success.
ok

Writing firmware...
CMD M28 Received.

Writing to file: dreamerx.bin
ok

CMD M29 Received.

Done saving file.
ok

Triggering firmware...
CMD M600 Received.

succeed
ok

Ending control loop...
CMD M600 Received.

succeed
ok

Flashing Completed, your printer will now reboot to the new firmware!

Flashing any firmware (manually)

For flashing a specific firmware, download the binary from the releases page and use the python script

As it can flash any firmware supported by the printer, you can use this to restore the stock firmware.

$ ./ff_flash_firmware.py /path/to/firmware.bin

Note for windows users

You can use the python script to directly flash the firmware. If this is not possible you can follow the instructions here: https://github.com/moonglow/FlashForge_Marlin/issues/16

Restoring to Stock firmware

This option is currently supported only on macOs

./install_marlin.sh <machine> --restore-ff-firmware

Note:

If you encounter timeouts, restart the same process. It usually takes twice for stock firmware (see Issue#16 )

Start and End G-code

Once you run on Marlin firmware, you need to update the start and end g-code in your slicer. This is important because, some of the start gcode flashforge firmware are different and especially the motor control voltages are handled differently in Marlin and Flashforge firmware.

Here's a good starting point gcode I use.

Start G-code

; Start G-Code

; Initial setup
M140 S[first_layer_bed_temperature] ; set bed temp
M190 S[first_layer_bed_temperature] ; wait for bed temp
M104 S[first_layer_temperature] ; set extruder temp
M109 S[first_layer_temperature] ; wait for extruder temp
M107 ; Fan off
G90 ; use absolute coordinates
G28 ; home all, this also disables previous bed level data

;Nozzle purge move

G1 X-70 Y-70 Z0.3 ;Move to bottom left
G1 X70 E20 F1500 ; Extrude across bed
G1 Y-69.6 ; Move up 0.4
G1 X-40 E20 F1500 ; part way back extruding
G1 X-70 F2000 ; Drain nozzle
G1 Z5 ; lift head

; End G-Code

End G-code

; Start G-Code

G27 ; Park nozzle
G1 Z140 F{travel_speed*60} ; lower bed to present
M140 S0 ; turn off heatbed
M104 S0 ; turn off temperature
M107 ; turn off fan
M84 X Y E ; disable motors

M73 P0 ; reset print progress
M117 Print Finished; 
; End G-Code

Building from source

!! IMPORTANT !!

If you don't know what you are doing, do not proceed, use one of the per-compiled firmware binaries

!! IMPORTANT !!

You can add/change the machine specific configs in ./configs/ and add a ifndef for the related configuration in the common configuration file at ./Marlin/Marlin/Configuration(_adv).h and compile it as follows -

./build_marlin.sh dreamer_nx  #build only, use ./ff_flash_firmware.py to flash this firmware


....

./build_marlin.sh dreamer_nx --flash # build and flash to printer directly

Supported Printers

  • Dreamer NX
  • Dreamer
  • Inventor