-
-
Notifications
You must be signed in to change notification settings - Fork 43
Writing OpenNep4une image without eMMC adapter
WARNING:
This procedure is experimental and potentially dangerous. If an error occurs, the system may become unbootable. Recovery will only be possible with a USB eMMC adapter. Proceed at your own risk.
Download the firmware image file.
Extract the image using the following command:
-
Linux:
xz -dc -T0 file.img.xz
-
Windows: Use 7z
Сopy the extracted image file onto USB flash drive.
-
Windows
users can use PuTTY. Here is a useful quick connection Guide. -
Linux
users can usescreen
for terminal access (linux commands below).Find the relevant ttyACM / ttyUSB device then paste yours into the command below.ls /dev/tty*
To exit screen, pressscreen /dev/tty* 1500000
Ctrl + A
followed byK
, then confirm withY
.
lsblk
Identify:
- The USB flash drive partition, usually something like /dev/sda(0-9).
- The eMMC device of the system, typically /dev/mmcblk(0-9). This device should have two partitions: /boot and /.
Hereinafter, I will use partition and device indices that were relevant to my setup, you will need to replace them with your own values.
mkdir /tmp/mnt
mount /dev/sda1 /tmp/mnt/
cd /tmp/mnt/
sudo systemctl isolate emergency.target
dd if=file.img of=/dev/mmcblk0 bs=4M conv=fsync status=progress
This process will overwrite the current system with the new firmware. Wait until the process completes.
reboot
In some cases, you might encounter errors while booting the new system. The following steps could help you recover:
Interrupt the boot process by pressing any key immediately after the terminal displays the boot message. You may need to repeatedly press the key to ensure you interrupt the process in time.
- Once in the U-Boot menu, execute the following commands:
lsblk
To view the files on the eMMC, use:
part list mmc 0
ls mmc 0:1
ls mmc 0:2
Identify the device you want to boot from. This could be either your eMMC if it contains viable data or a USB drive with a recorded image. If booting from eMMC, it will likely be /dev/mmcblk0p2.
- Set up the environment variables:
setenv fdtaddr 0x10000000 # address in memory for DTB
setenv loadaddr 0x20000000 # address in memory for core
setenv ramdisk_addr 0x30000000 # address in memory for initrd
setenv bootargs root=/dev/mmcblk0p2 rootwait
- Load the device tree file. For example, if you are using a Neptune 4 Pro board:
fatload mmc 0:1 ${fdtaddr} /dtb/rockchip/n4-n4pro-v1.1.dtb
Replace the filename with the correct one for your hardware. You can locate the file using:
ls mmc 0:2/dtb/rockchip/n4*
- Continue with the setup by loading the kernel and initrd:
fatload mmc 0:1 ${loadaddr} /Image
fatload mmc 0:1 ${ramdisk_addr} /uInitrd
- Finally, boot the system:
booti ${loadaddr} ${ramdisk_addr} ${fdtaddr}