klipper_canbus

MELLOW FLY SHT 36 v2

Important notes about this board.

Before proceeding, it is critical that your CAN network is configured for your printer, failure to setup the network will cause a problem when you try to connect devices :) click here and select your controller for setup instructions!

Flashing klipper firmware using CanBoot bootloader

1. Make sure your CAN network is terminated.

2. Determine which MCU your board uses

According to Mellow:

Note, please pay attention to the main control chip purchased after 2022-10-18, the first batch is GD32F103, and the later shipment is APM32F072

You’ll need to configure the Klipper firmware build differently depending on which chip your board has. The easiest way to tell the two MCUs apart is to match the text printed on the chip to the image below.

Difference between SHTv2 MCUs

Make a note of whether your MCU is STM32F103 or STM32F072. You’ll need this later.

3. Scan for can devices

python3 ~/klipper/lib/canboot/flash_can.py -q

You should see an output similar to this:

pi@mainsailos:~/klipper $ python3 ~/klipper/lib/canboot/flash_can.py -q
Resetting all bootloader node IDs...
Checking for canboot nodes...
Detected UUID: e5db694aab74, Application: Klipper
Query Complete

Note down the Detected UUID (In my case e5db694aab74).

If no device was found. Please check your wiring as well as your can0 linux interface.

4. Create the firmware file

cd ~/klipper
make clean
make menuconfig

SHT36 v2 Klipper Config using canboot

Now compile the firmware

make

5. Flash the firmware file onto the toolboard

python3 ~/klipper/lib/canboot/flash_can.py -u e5db694aab74

Once done you should see an output like this:

pi@mainsailos:~/klipper $ python3 ~/klipper/lib/canboot/flash_can.py -u e5db694aab74
Sending bootloader jump command...
Resetting all bootloader node IDs...
Checking for canboot nodes...
Detected UUID: e5db694aab74, Application: CanBoot
Attempting to connect to bootloader
CanBoot Connected
Protocol Version: 1.0.0
Block Size: 64 bytes
Application Start: 0x8002000
MCU type: stm32f103xe
Verifying canbus connection
Flashing '/home/pi/klipper/out/klipper.bin'...

[##################################################]

Write complete: 25 pages
Verifying (block count = 401)...

[##################################################]

Verification Complete: SHA = 9CFD8F9159D7AAB424E394C70DDCD7E9ADCE7815
CAN Flash Success

6. Verify firmware working

The Can query command:

python3 ~/klipper/lib/canboot/flash_can.py -q

Should now return:

pi@mainsailos:~/klipper $ python3 ~/klipper/lib/canboot/flash_can.py -q
Resetting all bootloader node IDs...
Checking for canboot nodes...
Detected UUID: e5db694aab74, Application: Klipper
Query Complete

And the LED on the toolboard should be always on.

SHT36 v2 flash result (physical)

Fixing a toolboard which was flashed wrong (for example wrong bootloader offset)

To fix a board without a working bootloader you will have to short a specific resistor. This will bring canboot back which will give you a new chance to flash the correct firmware!

SHT36 v2 bring back canboot by shorting resistor SHT36 v2 shorting resistor closeup

This led should then be blinking: SHT36 v2 flash result (physical)

Now correct the configured firmware and flash it again as described HERE

The board should now work again.