Apparently successful flash of Klipper half-bricks Mega Zero

Hi,

i flashed a Mega Zero with this Marlin (using Windows avrdude) :

It was fine and i could still communicate with the printer.

I then followed the Klipper install instructions here :

https://www.klipper3d.org/Installation.html

Klipper apparently flashed succesfully :


pi@octopi:~/klipper $ make flash FLASH_DEVICE=/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
Creating symbolic link out/board
Flashing out/klipper.elf.hex to /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 via avrdude

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: reading input file “out/klipper.elf.hex”
avrdude: writing flash (24948 bytes):

Writing | ################################################## | 100% 3.35s

avrdude: 24948 bytes of flash written
avrdude: verifying flash memory against out/klipper.elf.hex:
avrdude: load data flash data from input file out/klipper.elf.hex:
avrdude: input file out/klipper.elf.hex contains 24948 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.83s

avrdude: verifying …
avrdude: 24948 bytes of flash verified

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done. Thank you.


But then the printer was half-bricked, no display on the LCD (apart from backlight) and no response to any commands (though Octoprint thought it was connected to it).

I’ve now successfully reflashed with Marlin but am unsure as to what to do next as Klipper thought all went well.

Make sure your make menuconfig looks like this:
grafik

Try the config here: klipper/printer-anycubic-megazero-2020.cfg at master · MrNoob0/klipper · GitHub

If something does not work, then post the klipper log.

Thank you Sineos, that gave the same result.

The log file mentions missing section headers in printer.cfg so i’m looking at that now.

klippy.log (1.4 KB)

On first glance the cfg as linked above looks correct.
Log in to the Pi’s console and try:

wget https://raw.githubusercontent.com/MrNoob0/klipper/master/config/printer-anycubic-megazero-2020.cfg
mv printer-anycubic-megazero-2020.cfg printer.cfg

This error means that Klipper is unhappy with structure of the cfg, e.g things like [stepper_x] etc. Make sure it does not contain any surplus blanks, special characters etc.

Don’t forget to correct the [mcu] section after downloading

Thanks.

I did that and decided to see if it would flash while it was half-bricked, and Klipper thought all was fine still.

Reflashed with Marlin then tried again but same result, except frozen on info screen instead of a blank screen this time.

The printer.cfg file doesn’t seem to have any spurious characters, i’ve only edited it with nano and didn’t have to alter the [mcu] section.

I’m puzzled as to how avrdude thinks it’s verifying the flash when the device is half-bricked, i can understand it thinking writes are okay but not reads.

I tried flashing with the Zero unplugged, thankfully Klipper couldn’t find the path, thought i best try that in case Klipper was sending everything into the Ether!

There is not really something like “half-bricked”.

Klipper has two components:

  1. Software running on the Host / RPi: It manages all the logic and controls all functions
  2. Firmware running on the board / MCU: Managing the bare hardware and processing the commands from (1.)

To compare: In Marlin both (1.) and (2.) are the same and running on the MCU

So if your cfg is faulty, then (1.) will not correctly start and you will never even come near knowing if (2.) has actually worked or not.

Yes, slack terminology from me.

Thanks Sineos.

Just to make sure that we are on the same page:

  • The quote above relates to step (2.) → all flashing activities / avrdude etc. is only (2.)
  • Unless you fix your cfg and complete (1.) you will never know if avrdude actually did a correct job

An indication that (1.) is working will give you the klippy.log. It will show some start-up information and reprint your entire config.
If there are errors after this, then we will have to sort them out.

Thanks again for your time, i’ll look at the config again and try other suitable ones.

If you are new to Klipper, I would highly recommend avoiding copy and paste of config files. By all means, if you can get a working one from someone then do it. But before you start using it, go through it line-by-line and review the Klipper configuration documentation to understand what each entry does, even if it’s just a general understanding.

how to install printer.cfg for Anycubic Mega Zero 2.0:
cd /klipper/config
wget https://raw.githubusercontent.com/KevinOConnor/klipper/master/config/printer-creality-ender3-2018.cfg

cp ~/klipper/config/printer-creality-ender3-2018.cfg ~/printer.cfg

The Anycubic Mega Zero is a clone of the original ender3. Both use the atmega1284p with the identical pinout.