Flashing EMMC via USB Stick (No EMMC Reader Needed) - Phil1988/FreeDi GitHub Wiki
Special thanks for that 🙏
- This is a huuuge draft, it should be cleaned and completed when other people experiment
- This method worked for me, I can not guarantee it will for you, be ready to need the emmc to usb adapter, after all
- I used this on a Qidi X-MAX 3 that refused to boot from USB
- This is NOT clean, the end result is clean but the whole process is not.
- I repeat, it was tested only once, on my printer...
- I sent the final FS through the network, if it can not work fro you, maybe you will need a second USB key, and to connect two keys at the same time, needing to open the printer
- Write the latest image from release on a USB drive
- Ensure you have ssh access on the stock firmware
- plug the USB drive in the printer
- ssh to the printer (qidimax3 on my network)
❯ ssh mks@qidimax3
mks@qidimax3's password:
┌─────────────────────────────────────────────┐
│ ___ ___ ____ ___ _____ _____ ____ _ _ │
│ / _ \|_ _| _ \_ _| |_ _| ____/ ___| | | |│
│| | | || || | | | | | | | _|| | | |_| |│
│| |_| || || |_| | | | | | |__| |___| _ |│
│ \__\_\___|____/___| |_| |_____\____|_| |_|│
│ │
└─────────────────────────────────────────────┘
+-------------------------------------------------------------------------------+
| Warning: Modifying system files and installing unofficial plugins means that |
| the customer is waiving their expectations of official support. They will be |
| solely responsible for the security and safety of their printer. Any firmware |
| issues arising from these modifications will not be covered under warranty. |
+-------------------------------------------------------------------------------+
Welcome to Armbian 22.05.0-trunk with bleeding edge Linux 5.16.20-rockchip64
No end-user support: built from trunk
System load: 36% Up time: 1 min
Memory usage: 18% of 976M IP: 192.168.666.222
CPU temp: 45°C Usage of /: 76% of 6.6G
storage/: 35% of 256M
- check if the USB disk has been mounted, and unmount it if it was
mks@mkspi:~$ mount |grep /home/mks/gcode_files
/dev/sda1 on /home/mks/gcode_files/sda1 type vfat (rw,nosuid,nodev,noexec,relatime,gid=100,fmask=0111,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,flush,errors=remount-ro)
mks@mkspi:~$ sudo umount /home/mks/gcode_files/sda1
[sudo] password for mks:
- become root
sudo -s
- unmount /boot and logs
root@mkspi:/home/mks# umount /boot
root@mkspi:/home/mks# umount /var/log.hdd
- break everything...and flash the USB image onto the eMMC
Yes the system will not be happy, and it can result into a "bricked" (until you have emmc to usb hardware)
root@mkspi:/home/mks# dd if=/dev/sda of=/dev/mmcblk1 bs=4M
Message from syslogd@mkspi at Feb 4 13:18:10 ...
systemd[1]: Caught <ILL>, core dump failed (child 2446, code=killed, status=4/ILL).
Broadcast message from systemd-journald@mkspi (Tue 2025-02-04 13:18:10 CET):
systemd[1]: Caught <ILL>, core dump failed (child 2446, code=killed, status=4/ILL).
Broadcast message from systemd-journald@mkspi (Tue 2025-02-04 13:18:10 CET):
systemd[1]: Freezing execution.
Message from syslogd@mkspi at Feb 4 13:18:10 ...
systemd[1]: Freezing execution.
dd: error writing '/dev/mmcblk1': No space left on device
1865+0 records in
1864+0 records out
7818182656 bytes (7.8 GB, 7.3 GiB) copied, 255.78 s, 3d+01 MB/s
Connection to qidimax3 closed.
- poweroff and on again leave the USB key in the printer !
- ssh in the system again you will have an error, about the key, that's normal and it means you booted from the usb drive
❯ ssh mks@qidimax3
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:BlAbKabKaBlaBla/dEAdCat.
Please contact your system administrator.
Add correct host key in /home/nic/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/nic/.ssh/known_hosts:5275
Host key for qidimax3 has changed and you have requested strict checking.
Host key verification failed.
correct the situation and ssh again
❯ ssh mks@qidimax3
The authenticity of host 'qidimax3 (192.168.69.222)' can't be established.
ED25519 key fingerprint is SHA256:bloubloubou/d4rthv4der.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'qidimax3' (ED25519) to the list of known hosts.
mks@qidimax3's password:
_ _
_ __ ___ | | _____ _ __ (_)
| '_ ` _ \| |/ / __| '_ \| |
| | | | | | <\__ \ |_) | |
|_| |_| |_|_|\_\___/ .__/|_|
|_|
Welcome to Armbian-unofficial 24.2.0-trunk Bookworm with Linux 6.6.17-current-rockchip64
No end-user support: built from trunk
System load: 54% Up time: 1 min
Memory usage: 23% of 911M IP: 192.168.69.222
CPU temp: 40°C Usage of /: 70% of 6.7G
RX today: 10.0 MiB
Yay ! ... But you're still booting from USB, kinda...(the /boot is on the emmc, the / is on the USB)
Now, the system should tell you it is updating the display firmware, let it finish it. When done the screen of the printer should show you nice illustration of the printer with a "booting" message
I sent the image from my computer through ssh, but if you have windows I don't know if it works. So from the directory I uncompressed the image:
cat FreeDi_v1.40_X-Max3_Armbian24.2.0_Bookworm6.6.17.img |ssh root@qidimax3 "dd status=progress of=/dev/mmcblk1"
root@qidimax3's password:
7810626048 bytes (7.8 GB, 7.3 GiB) copied, 882 s, 8.9 MB/s
15269888+0 records in
15269888+0 records out
7818182656 bytes (7.8 GB, 7.3 GiB) copied, 883.862 s, 8.8 MB/s
I guess, but this must be confirmed, you can also do it from the booted USB (I did nbot since the FS is mounted, so the resulting copy is not consistent, the filesystem check at boot should correct it but unsure)
- Ensure everything is written on disk
mks@mkspi:~$ sudo sync
[sudo] password for mks:
Final reboot, now you should be able to continue the guide from here