compile the klipper firmware, making the changes to the config as needed first: https://www.klipper3d.org/Installation.html#building-and-flashing-the-micro-controller
run the nano convert python script in the script folder on the generated bin file; rename to Robin_nano_v3.bin
put it on a fat32 16gb uSD card and put it into the MKS baord and boot it up; give it 15 minutes
check the uSD content's after; the bin should be renamed to .cur, otherwise it didn't work.
If it did't work download source for openocd; build/install
Target GND to Pi GND Target SWDIO to Raspberry Pi #24 Target SWCLK to Raspberry Pi #25 Target Reset to Raspberry Pi #18 Power the PI via USB; have the USB twitch power set to ON
For the Robin Nano V3.1, the addresses are: BootLoader:0x08000000-0x0800c000 App start address:0x0800c000
create file named openocd.cfg:
source /usr/local/share/openocd/scripts/interface/raspberrypi2-native.cfg
transport select swd
set CHIPNAME stm32f4
source /usr/local/share/openocd/scripts/target/stm32f4x.cfg
reset_config srst_nogate
adapter_nsrst_delay 100
adapter_nsrst_assert_width 100
init
targets
reset halt
create file /usr/local/share/openocd/scripts/interface/raspberrypi2-native.cfg
:
interface bcm2835gpio
bcm2835gpio_peripheral_base 0x3F000000
bcm2835gpio_speed_coeffs 146203 36
bcm2835gpio_swd_nums 25 24
bcm2835gpio_srst_num 18
reset_config srst_only srst_push_pull
sudo openocd
from a second terminal:
flash erase_sector 0 0 6
flash write_bank 0 nano_v3_bootloader.bin 0x0000 # nano_v3_bootloader - the beep version, provided by mks
if an error, try again or try: flash write_bank 0 nano_v3_bootloader.bin 0
if you want to flash the firmware also,
flash write_bank 0 Robin_nano_v3.bin 0x0c00
But it's better to just put Robin_nano_v3.bin on a uSD card and try again.
You should be good then.
dmesg | grep "SerialNumber:" # check the serial number of the USB device once connected
update printer.cfg