2

Alternate Firmware Flashing Method

Hey all,

I fought with the method to update the SW X1 V4 Firmware w/out having to man-handle the TFT cable out of it. I found success doing the following:

1) SCP the .hex file to my /home/pi directory for my octopi/octoprint server (Raspberry Pi 3b)

2) sudo apt-get update && apt-get install avrdude

3) CD to the folder that you loaded the .hex file to. Preferably the /home/pi directory. Run the following. Plug in your printer right after hitting enter on the command:

while true; do sudo /usr/bin/avrdude -v -p atmega2560 -c wiring -P $(ls /dev/ttyUSB*) -b 115200 -D -U flash:w:./SW-X1_Marlin2.0.5.3_MBL
.hex:i; if [ "$?" -eq "0" ]; then break; fi; done;

You'll likely get a ton of the following:

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/root/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude done. Thank you.

That's ok. Just let it go for a while.

Eventually, I hit the reset button once or twice (I think I did it once and it still didn't work after running for a while, so I hit it again).

At some point, directly following hitting the reset button, I began getting the below output which I take as being successful.

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/root/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude: stk500v2_ReceiveMessage(): timeout
AVR Part : ATmega2560
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 10 8 0 no 4096 8 0 9000 9000 0x00 0x00
flash 65 10 256 0 yes 262144 256 1024 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Wiring
Description : Wiring
Programmer Model: AVRISP
Hardware Version: 15
Firmware Version Master : 2.10
Vtarget : 0.0 V
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: reading input file "./SW-X1_Marlin2.0.5.3_MBL.hex"
avrdude: writing flash (261406 bytes):
Writing | ################# | 34% 5.48savrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
Writing | ################################# | 66% 20.61savrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
Writing | ################################################## | 100% 34.78s
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: 261406 bytes of flash written
avrdude: verifying flash memory against ./SW-X1_Marlin2.0.5.3_MBL.hex:
avrdude: load data flash data from input file ./SW-X1_Marlin2.0.5.3_MBL.hex:
avrdude: input file ./SW-X1_Marlin2.0.5.3_MBL.hex contains 261406 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 11.60s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x8700
0xff != 0x05
avrdude: verification error; content mismatch
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D8, L:FF)
avrdude done. Thank you.
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/root/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : wiring
Overriding Baud Rate : 115200
AVR Part : ATmega2560
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 10 8 0 no 4096 8 0 9000 9000 0x00 0x00
flash 65 10 256 0 yes 262144 256 1024 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Wiring
Description : Wiring
Programmer Model: AVRISP
Hardware Version: 15
Firmware Version Master : 2.10
Vtarget : 0.0 V
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: reading input file "./SW-X1_Marlin2.0.5.3_MBL.hex"
avrdude: writing flash (261406 bytes):
Writing | ################################### | 69% 11.12savrdude: stk500v2_ReceiveMessage(): timeout
Writing | ################################################## | 100% 19.79s
avrdude: 261406 bytes of flash written
avrdude: verifying flash memory against ./SW-X1_Marlin2.0.5.3_MBL.hex:
avrdude: load data flash data from input file ./SW-X1_Marlin2.0.5.3_MBL.hex:
avrdude: input file ./SW-X1_Marlin2.0.5.3_MBL.hex contains 261406 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 11.59s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x10d00
0xff != 0x8a
avrdude: verification error; content mismatch
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D8, L:FF)
avrdude done. Thank you.
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/root/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : wiring
Overriding Baud Rate : 115200
AVR Part : ATmega2560
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 10 8 0 no 4096 8 0 9000 9000 0x00 0x00
flash 65 10 256 0 yes 262144 256 1024 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Wiring
Description : Wiring
Programmer Model: AVRISP
Hardware Version: 15
Firmware Version Master : 2.10
Vtarget : 0.0 V
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: reading input file "./SW-X1_Marlin2.0.5.3_MBL.hex"
avrdude: writing flash (261406 bytes):
Writing | ################################################## | 100% 14.82s
avrdude: 261406 bytes of flash written
avrdude: verifying flash memory against ./SW-X1_Marlin2.0.5.3_MBL.hex:
avrdude: load data flash data from input file ./SW-X1_Marlin2.0.5.3_MBL.hex:
avrdude: input file ./SW-X1_Marlin2.0.5.3_MBL.hex contains 261406 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 11.60s
avrdude: verifying ...
avrdude: 261406 bytes of flash verified
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D8, L:FF)
avrdude done. Thank you.

I'm not sure if this is true, but it feels like it actually flashed it three or so times! Either way, I immediately flashed the TFT using the normal method and reconnected Octoprint. I am now printing a calibration cat just to ensure it's WORKING... Will tune everything after.

So far, the only oddity is that the temp seems a bit too wavy... It could be that I have a ceiling fan on though.

HUGE shout out to joskfg and Rgutendorfjr at Thingiverse.:

 https://www.thingiverse.com/make:734108/ 

6replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • That's awesome, thanks for sharing! Someone on the FB group just told us that a similar effect can be built into the tft menu, where you can turn off the screen to flash, and then tap it again to turn after flashed. I'll talk to Gavin about it tonight!

    Like 1
    • Bahij Nemeh Cool. I love the TFT firmware and am really looking forward to seeing this printer get tuned with Linear Advance. That said, I am running in to some significant print issues. I posted on the FB group about it, but something is very odd with adhesion that prints just aren't going down/staying down correctly.

      I got the below results multiple times at different points of the print. The block comes off of the bed and gets stuck to the nozzle. Not saying it's 100% because of flashing the firmware, but the correlation exists as I had never had any problems (like this) prior.

      Like
    • Bahij Nemeh Just realized that I can't find an edit button for the post. When I hit the ... up top it just gives me the option to follow it.

      Like
  • Awesome! Thanks for the update Wes.  Yeah, it looks like it did flash it more than once but who cares, right?  On a side note, since you're flashing from Linux you should look into Platformio. That's what I use to update firmware on all of my printers.  Marlin even comes with a platformio.ini file already included. 

    Like 1
    • Terry Bogayong Thanks. Platformio is an IDE, right? I'll check it out.

      Like
    • Wes Crockett Yes, it has an IDE but it really is more than just an IDE. It's an ecosystem. Yeah, check it out. I think you'll like it.

      Like 1
Like2 Follow
  • 2 Likes
  • 2 mths agoLast active
  • 6Replies
  • 146Views
  • 3 Following