diff --git a/docs/EMMC_BACKUP.md b/docs/EMMC_BACKUP.md index 2c3e775..a983de3 100644 --- a/docs/EMMC_BACKUP.md +++ b/docs/EMMC_BACKUP.md @@ -1,11 +1,13 @@ # EMMC Backup Procedure -This procedure is recommended to be performed when your printer is completely setup in a well working condition. It is possible to create complete eMMC backup ( 15 minutes / 8GB) or just a backup of the system partitions ( 2 minutes / 600MB ). It is recommended to have at least one complete backup and one or two system backups at different firmware versions. The procedure uses the uboot functionality to read/write the eMMC and to read/write USB disks. The backup procedure copy the entire eMMC (or just the system partitions) on a USB disk. Then on a Linux host you can create image of the USB disk to have it as a backup file. +This procedure is recommended to be performed when your printer is completely setup in a well working condition. It is possible to create complete eMMC backup for about 15 minutes for eMMC size of about 8GB. It is recommended to have at least one complete backup. The procedure uses the uboot functionality to read/write the eMMC and to read/write USB disks. The backup procedure copy the entire eMMC on a USB disk. Then on a Linux host you can create image of the USB disk to have it as a backup file. To perform a backup follow these steps: +## By the uboot console + 1. Use the original app version 2.39 and stop the booting process by holding key 's' (or use any custom firmware update that has the UART enabled) -2. Insert a USB disk (FAT32 formatted) with the file [backup.scr](../extra-stuff/emmc/backup.scr) on it for complete emmc backup. If you need to backup just the system partitions use the file [sbackup.scr](../extra-stuff/emmc/sbackup.scr) instead. +2. Insert a USB disk (FAT32 formatted) with the file [backup.scr](../extra-stuff/emmc/backup.scr) on it for complete emmc backup. 3. From the uboot shell enter the following: ```sh @@ -34,40 +36,30 @@ fatload usb 0:1 42000000 backup.scr (Partition 1) -For a system backup replace the above script name `backup.scr` with the name `sbackup.scr`. +1. Remove the USB disk with the scripts and insert at least 8GB USB disk for a complete backup. It might be formatted or not and it will be completely rewritten by the contents of the eMMC. NOTE: Do not use a disk with important information! All data on it will be lost! -4. Remove the USB disk with the scripts and insert at least 8GB USB disk for a complete backup (or at least 1GB USB disk for a system backup). It can be formatted or not and it will be completely rewritten by the contents of the eMMC. NOTE: Do not use a disk with important information! All data on it will be lost! - -5. Type the following to execute the script: +2. Type the following to execute the script: ```sh source 42000000 ``` -6. Wait about 15 minutes (or about 2 minutes for a system backup) and the entire emmc (or the system part of it) will be transferred 1:1 to the USB disk +1. Wait about 15 minutes and the entire emmc will be transferred 1:1 to the USB disk sector by sector If you see an error and the script stopped before showing 100%, insert another type USB disk and enter again: ```sh source 42000000 ``` -7. From a linux machine export the complete backup as a file from the USB disk: +7. From a Linux machine export the complete backup as a file from the USB disk: ```sh dd if=/dev/sdh of=emmc_backup.bin bs=512 count=15269888 status=progress ``` -or the system backup: - -```sh -dd if=/dev/sdh of=emmc_system_backup.bin bs=512 count=1135648 status=progress -``` - Note: replace the `/dev/sdh` with the device name of your USB disk. ---- - -With the xfel tool +## By the standard or the custom xfel tool in uboot mode This mode can be used when the version you are using has the uart disabled and you are unable to stop the booting process and to enter in the uboot shell. @@ -102,8 +94,6 @@ You can modify the script and create new backup.scr image by: mkimage -T script -n 'EMMC Backup' -d backup.txt backup.scr ``` -or for the system backup: +## By the custom xfel tool in USB mode -```sh -mkimage -T script -n 'EMMC System Backup' -d sbackup.txt sbackup.scr -``` +TBD diff --git a/docs/EMMC_RESTORE.md b/docs/EMMC_RESTORE.md index 7fad286..bcaa70d 100644 --- a/docs/EMMC_RESTORE.md +++ b/docs/EMMC_RESTORE.md @@ -1,10 +1,12 @@ # EMMC Restore Procedure -This procedure can be performed when you already have a good backup and your printer is not working properly or even cannot boot. Another use case is to fast switch to another printer setup by replacing the system partitions or the entire eMMC with the content from another setup. The procedure uses the uboot functionality to read/write the eMMC and to read/write USB disks. The restore procedure recovers the entire eMMC (or just the system partitions) from a USB disk backup. +This procedure can be performed when you already have a good backup and your printer is not working properly or even cannot boot. Another use case is to fast switch to another printer setup by replacing the system partitions or the entire eMMC with the content from another setup. The procedure uses the uboot functionality to read/write the eMMC and to read/write USB disks. The restore procedure recovers the entire eMMC from a USB disk backup. -To perform a restore follow these steps according to the current printer working state (A/ or B/): +To perform a restore follow these steps according to the current printer working state (Case A, B or C): -A/ In case your printer is in good working conditions (it can somehow boot) and you are using firmware version that has uboot enabled. +## Case A + +In case your printer is in good working conditions (it can somehow boot) and you are using firmware version that has uboot enabled. 1. Turn on the printer and stop the booting process by holding key 's' 2. Insert a USB disk (FAT32 formatted) with the file [restore.scr](../extra-stuff/emmc/restore.scr) on it for complete emmc restore. If you need to restore just the system partitions use the file [srestore.scr](../extra-stuff/emmc/srestore.scr) instead. @@ -38,29 +40,22 @@ fatload usb 0:1 42000000 restore.scr For a system restore replace the above script name `restore.scr` with the name `srestore.scr`. -4. Remove the USB disk with the scripts and insert the 8GB USB disk with the complete backup (or the 1GB USB disk with the system backup). +4. Remove the USB disk with the scripts and insert the 8GB USB disk with the complete backup. 5. ONLY IN CASE YOU DONT' HAVE A backups on a USB disk you can create them from the backup files on a Linux machine, otherwise go step 5. ```sh -dd of=emmc_backup.bin of=/dev/sdh bs=512 count=15269888 status=progress -``` - -or in case of system backup: - -```sh -dd of=emmc_system_backup.bin of=/dev/sdh bs=512 count=1135648 status=progress +dd if=emmc_backup.bin of=/dev/sdh bs=512 count=15269888 status=progress ``` Note: replace the `/dev/sdh` with the device name of your USB disk. - -5. Type the following to execute the script: +1. Type the following to execute the script: ```sh source 42000000 ``` -6. Wait about 15 minutes (or about 2 minutes for a system backup) and the entire emmc (or the system part of it) will be restored 1:1 from the USB disk +1. Wait about 15 minutes and the entire emmc will be restored 1:1 from the USB disk sector by sector If you see an error and the script stopped before showing 100%, insert another type USB disk and enter again: ```sh @@ -69,9 +64,9 @@ source 42000000 7. Reset the printer or power off / power on and you should have a fully working machine like at the time the backup was taken. ---- +## Case B -B/ With the xfel tool in case your printer cannot boot at all or you are using a firmware version that disable the UART and you don't have access to the uboot shell. +With the standard or the custom xfel tool in case your printer cannot boot or you are using a firmware version that disable the UART and you don't have access to the uboot shell. To boot into uboot shell: @@ -98,8 +93,22 @@ You can modify the script and create new restore.scr image by: mkimage -T script -n 'EMMC Restore' -d restore.txt restore.scr ``` -or for the system restore: +## Case C + +In case when after trying to use case B, you cannot enter in the uboot console for any reason (including the uart has some hardware issues). +Your printer should be in FEL mode. If not, try to enter in FEL mode as described in the document for FEL mode. + +- Connect the printer left USB slot (with the camera icon) to the computer with male to male USB cable (1:1 pin connection) +- Execute this command to verify if the printer is in FEL mode -```sh -mkimage -T script -n 'EMMC System Restore' -d srestore.txt srestore.scr ``` +xfel extra sdmmc detect +``` + +- If you don't receive error executing the above command, start restoring the entire eMMC by: + +``` +xfel extra sdmmc write 0 backup.bin +``` + +NOTE: Replace `backup.bin` by the filename of your backup file diff --git a/extra-stuff/emmc/sbackup.scr b/extra-stuff/emmc/sbackup.scr deleted file mode 100644 index 8da9384..0000000 Binary files a/extra-stuff/emmc/sbackup.scr and /dev/null differ diff --git a/extra-stuff/emmc/sbackup.txt b/extra-stuff/emmc/sbackup.txt deleted file mode 100644 index fe2f524..0000000 --- a/extra-stuff/emmc/sbackup.txt +++ /dev/null @@ -1,78 +0,0 @@ -echo ---------------------------------------------- -echo --- EMMC SYSTEM BACKUP ON A USB DISK --- -echo ---------------------------------------------- -echo -sleep 5 -echo -echo ---------------------------------------------- -echo REMOVE ALL USB DEVICES AND ISERT 2GB+ USB DISK -echo ---------------------------------------------- -echo 10... -sleep 2 -echo 9... -sleep 2 -echo 8... -sleep 2 -echo 7... -sleep 2 -echo 6... -sleep 2 -echo 5... -sleep 2 -echo 4... -sleep 2 -echo 3... -sleep 2 -echo 2... -sleep 2 -echo 1... -sleep 2 -echo 0... -sleep 2 -echo --------------------------------- INITIALIZING ------------------------------- -sunxi_card0_probe -mmc dev 0 -usb reset -usb dev 0 -echo --------------------------------- EMMC >>> USB ------------------------------- -mmc read 40000000 00000000 10000 -usb write 40000000 00000000 10000 -mmc read 40000000 00010000 10000 -usb write 40000000 00010000 10000 -mmc read 40000000 00020000 10000 -usb write 40000000 00020000 10000 -mmc read 40000000 00030000 10000 -usb write 40000000 00030000 10000 -mmc read 40000000 00040000 10000 -usb write 40000000 00040000 10000 -echo ------------------------------------ 25% ------------------------------------- -mmc read 40000000 00050000 10000 -usb write 40000000 00050000 10000 -mmc read 40000000 00060000 10000 -usb write 40000000 00060000 10000 -mmc read 40000000 00070000 10000 -usb write 40000000 00070000 10000 -mmc read 40000000 00080000 10000 -usb write 40000000 00080000 10000 -mmc read 40000000 00090000 10000 -usb write 40000000 00090000 10000 -echo ------------------------------------ 50% ------------------------------------- -mmc read 40000000 000a0000 10000 -usb write 40000000 000a0000 10000 -mmc read 40000000 000b0000 10000 -usb write 40000000 000b0000 10000 -mmc read 40000000 000c0000 10000 -usb write 40000000 000c0000 10000 -mmc read 40000000 000d0000 10000 -usb write 40000000 000d0000 10000 -echo ------------------------------------ 75% ------------------------------------- -mmc read 40000000 000e0000 10000 -usb write 40000000 000e0000 10000 -mmc read 40000000 000f0000 10000 -usb write 40000000 000f0000 10000 -mmc read 40000000 00100000 10000 -usb write 40000000 00100000 10000 -mmc read 40000000 00110000 5420 -usb write 40000000 00110000 5420 -echo ------------------------------------ 100% ------------------------------------ - diff --git a/extra-stuff/emmc/srestore.scr b/extra-stuff/emmc/srestore.scr deleted file mode 100644 index 74a935d..0000000 Binary files a/extra-stuff/emmc/srestore.scr and /dev/null differ diff --git a/extra-stuff/emmc/srestore.txt b/extra-stuff/emmc/srestore.txt deleted file mode 100755 index 2a1268a..0000000 --- a/extra-stuff/emmc/srestore.txt +++ /dev/null @@ -1,84 +0,0 @@ -echo ----------------------------------------------- -echo --- EMMC SYSTEM RESTORE FROM USB DISK --- -echo ----------------------------------------------- -echo -sleep 5 -echo -echo ----------------------------------------------- -echo REMOVE ALL USB DEVICES AND INSERT 2GB+ USB DISK -echo WITH THE SYSTEM IMAGE YOU WANT TO RESTORE -echo -echo IT WILL COPY THE USB BLOCKS TO THE EMMC BLOCKS! -echo -echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -echo !TURN OFF THE PRINTER NOW IF YOU ARE NOT READY! -echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -echo ----------------------------------------------- -echo 10... -sleep 2 -echo 9... -sleep 2 -echo 8... -sleep 2 -echo 7... -sleep 2 -echo 6... -sleep 2 -echo 5... -sleep 2 -echo 4... -sleep 2 -echo 3... -sleep 2 -echo 2... -sleep 2 -echo 1... -sleep 2 -echo 0... -sleep 2 -echo --------------------------------- INITIALIZING ------------------------------- -sunxi_card0_probe -mmc dev 0 -usb reset -usb dev 0 -echo --------------------------------- USB >>> EMMC ------------------------------- -usb read 40000000 00000000 10000 -mmc write 40000000 00000000 10000 -usb read 40000000 00010000 10000 -mmc write 40000000 00010000 10000 -usb read 40000000 00020000 10000 -mmc write 40000000 00020000 10000 -usb read 40000000 00030000 10000 -mmc write 40000000 00030000 10000 -usb read 40000000 00040000 10000 -mmc write 40000000 00040000 10000 -echo ------------------------------------ 25% ------------------------------------- -usb read 40000000 00050000 10000 -mmc write 40000000 00050000 10000 -usb read 40000000 00060000 10000 -mmc write 40000000 00060000 10000 -usb read 40000000 00070000 10000 -mmc write 40000000 00070000 10000 -usb read 40000000 00080000 10000 -mmc write 40000000 00080000 10000 -usb read 40000000 00090000 10000 -mmc write 40000000 00090000 10000 -echo ------------------------------------ 50% ------------------------------------- -usb read 40000000 000a0000 10000 -mmc write 40000000 000a0000 10000 -usb read 40000000 000b0000 10000 -mmc write 40000000 000b0000 10000 -usb read 40000000 000c0000 10000 -mmc write 40000000 000c0000 10000 -usb read 40000000 000d0000 10000 -mmc write 40000000 000d0000 10000 -echo ------------------------------------ 75% ------------------------------------- -usb read 40000000 000e0000 10000 -mmc write 40000000 000e0000 10000 -usb read 40000000 000f0000 10000 -mmc write 40000000 000f0000 10000 -usb read 40000000 00100000 10000 -mmc write 40000000 00100000 10000 -usb read 40000000 00110000 5420 -mmc write 40000000 00110000 5420 -echo ------------------------------------ 100% ------------------------------------