makerbase-mks / MKS-SKIPR

MKS SKIPR is an all-in-one board launched by Makerbase for running Klipper. It integrates the RK3328 SOC running the Klipper host and the STM32F407VET6 MCU responsible for executing specific machine actions. It meets the use of most 3D printers.
GNU General Public License v3.0
91 stars 15 forks source link

MCU Protocol error #72

Closed BETLOG closed 8 months ago

BETLOG commented 8 months ago

I did a software update via fluidd gui today, not the first time I have done this, but now i have a serious issue:

MCU Protocol error

This is frequently caused by running an older version of the
firmware on the MCU(s). Fix by recompiling and flashing the
firmware.

Your Klipper version is: v0.12.0-86-gdaf875e6
MCU(s) which should be updated:
mcu: Current version v0.10.0-530-g3387a9c2-dirty-20220807_204823-mkspi
rpi: Current version v0.11.0-121-ga5fb2076
Up-to-date MCU(s):

Once the underlying issue is corrected, use the "RESTART"
command to reload the config and restart the host software.

mcu 'rpi': Command format mismatch: query_adxl345 oid=%c rest_ticks=%u vs query_adxl345 oid=%c clock=%u rest_ticks=%u

I do vaguely recall reading an MKS note about not doing any updates, but (iirc) that was specific to Armbian, ie: not fluidd/klipper components.

So far I have tried:

mv /home/mks/klipper /home/mks/klipper_$(date +%Y-%m-%d)
git clone https://github.com/Klipper3d/klipper
./klipper/scripts/install-octopi.sh
cd ~/klipper/
make menuconfig
    STM32
    STM32F407
    48KiB
    8MHz
    USART1 PA10/PA9
    250000
make
sudo mkdir /media/mks
sudo chown mks:mks /media/mks
sudo mount /dev/mmcblk0p1 /media/mks
sudo cp /home/mks/klipper/out/klipper.bin /media/mks/mks_skipr.bin
ls /media/mks
mks_skipr.bin
sudo umount /media/mks

Physically switch TF card from host to mcu slots. Shutdown. Power up. Confirm flash successful:

sudo mount /dev/mmcblk0p1 /media/mks
ls /media/mks
mks_skipr.CUR

Where do I go from here?

Is flashing the 2+ YEAR old stock MKS image even a solution? I'm pretty sure that will have the same issue as recompiling klipper, as above.

BETLOG commented 8 months ago

After some closer scrutiny on WHAT has the outdated version, i realise the MCU flash is working fine, its the rpi component thats outdated..... I don't understand why thats not determined by the git clone

Original error:

Your Klipper version is: v0.12.0-86-gdaf875e6 MCU(s) which should be updated: mcu: Current version v0.10.0-530-g3387a9c2-dirty-20220807_204823-mkspi rpi: Current version v0.11.0-121-ga5fb2076 Up-to-date MCU(s):

Error after reflashing MCU:

Your Klipper version is: v0.12.0-86-gdaf875e6 MCU(s) which should be updated: rpi: Current version v0.11.0-121-ga5fb2076 Up-to-date MCU(s): mcu: Current version v0.12.0-86-gdaf875e6

I am confused; why isn't the rpi updating? Is fluidd pulling an older version? I don't understand why the host version isnt determined by recompiling ~/klipper git pull directory. I must be overlooking something basic.

BETLOG commented 8 months ago

Ok, so I'm a noob still. A noob who NOW knows he needs to do a make specifically for the host, as well as one for the printer hardware mcu.

https://www.klipper3d.org/RPi_microcontroller.html#install-the-rc-script


Install the rc script[¶](https://www.klipper3d.org/RPi_microcontroller.html#install-the-rc-script)
If you want to use the host as a secondary MCU the klipper_mcu process must run before the klippy process.

After installing Klipper, install the script. run:

cd ~/klipper/
sudo cp ./scripts/klipper-mcu.service /etc/systemd/system/
sudo systemctl enable klipper-mcu.service
Building the micro-controller code[¶](https://www.klipper3d.org/RPi_microcontroller.html#building-the-micro-controller-code)
To compile the Klipper micro-controller code, start by configuring it for the "Linux process":

cd ~/klipper/
make menuconfig
In the menu, set "Microcontroller Architecture" to "Linux process," then save and exit.

To build and install the new micro-controller code, run:

sudo service klipper stop
make flash
sudo service klipper start
If klippy.log reports a "Permission denied" error when attempting to connect to /tmp/klipper_host_mcu then you need to add your user to the tty group. The following command will add the "pi" user to the tty group:

sudo usermod -a -G tty pi```