Flash an Image to eMMC
Use this page to write a complete image to a board's eMMC, for example on a production line, on a board you designed, or with an image that is not a published release. You run every step yourself, so it works with any image file you have.
To update a DevKit to a published SiMa.ai release, use Firmware Update instead. To replace only the kernel, device trees, or U-Boot on a board that already boots, see Install the Artifacts.
Before You Start
-
A board that reaches the U-Boot prompt.
-
A serial connection to the board's U-Boot/Linux UART at 115200 baud with hardware flow control disabled. See Configure Serial Connection.
-
The image to flash:
Image Files eLxr elxr-palette-modalix-<version>-arm64.imgYocto simaai-image-minimal-modalix.rootfs.wic.gzandsimaai-image-minimal-modalix.rootfs.wic.bmapThe Yocto file names are the ones that Build a Complete Image with Yocto produces. Another image recipe gives other names.
-
Either a host with Ethernet and a TFTP server, or an SD card.
How the Board Chooses a Boot Source
A board can't overwrite the eMMC while it is running from it, so it first boots
from the network or an SD card. U-Boot tries the sources in boot_targets in
order:
| Target | Boots from |
|---|---|
mmc1 | SD card |
mmc0 | eMMC |
dhcp | TFTP server found through DHCP |
net | TFTP server at a static IP address |
The default order is mmc1 mmc0 dhcp net. To change it, interrupt autoboot in
the serial console, then set and save the order:
sima$ env set boot_targets mmc1 mmc0 net dhcp; saveenv
Saving Environment to FAT... OK
sima$ printenv boot_targets
boot_targets=mmc1 mmc0 net dhcp
sima$ boot
Step 1. Boot From the Network or an SD Card
Booting from an SD card is preferred on a test station, because it leaves the Ethernet ports free for network stress tests.
Boot from the network
This uses your own TFTP server, so you choose what it serves.
Net Boot Recovery does the
same with sima-cli, which downloads and serves a published release for you.
-
Copy the boot files to the TFTP server's root directory:
netboot.scr.uimgImage- the device tree blobs (
*.dtb) - the root filesystem archive:
elxr-palette-modalix-arm64.cpio.gzfor eLxr, orsimaai-image-palette-modalix.cpio.gzfor Yocto
-
Connect the host to the board's first Ethernet port (
eth0). The board uses192.168.1.20, so give the host an address on192.168.1.0/24:sima-user@sima-user-machine:~$ sudo ifconfig <interface_name> 192.168.1.10 up -
Power on the board, interrupt autoboot, and make
netthe first boot source:sima$ env set boot_targets net mmc0 mmc1 dhcp; saveenvsima$ boot -
After Linux boots, confirm the build and that the root filesystem is in RAM (
root=/dev/ram0):root@modalix:~# cat /etc/buildinforoot@modalix:~# cat /proc/cmdline
Boot from an SD card
-
Write the image to the SD card. You can write it from the host with Create Boot Image, or from a board you booted from the network with the SD card inserted (
/dev/mmcblk1):For eLxr:
root@modalix:~# dd if=/tmp/elxr-palette-modalix-<version>-arm64.img of=/dev/mmcblk1 bs=4M status=progress conv=fsyncFor Yocto, copy both the
.wic.gzand.wic.bmapfiles, then:root@modalix:~# bmaptool copy /tmp/simaai-image-minimal-modalix.rootfs.wic.gz /dev/mmcblk1Then repair the partition table. The image is smaller than the card, so the backup GPT header is not at the end of the device until
partedmoves it:root@modalix:~# printf "fix\n" | parted ---pretend-input-tty /dev/mmcblk1 print -
Reboot, interrupt autoboot, and make sure
mmc1comes first. It does by default:sima$ env set boot_targets mmc1 mmc0 dhcp net; saveenvsima$ boot -
After Linux boots, check
/etc/buildinfo, and check/proc/cmdlineforroot=/dev/mmcblk1p*.
Step 2. Write the Image to eMMC
Run these steps on the board, as root, while it is booted from the network or the SD card.
-
Copy the image from the host to
/tmpon the board.For eLxr:
sima-user@sima-user-machine:~$ scp elxr-palette-modalix-<version>-arm64.img root@192.168.1.20:/tmp/For Yocto, copy both the
.wic.gzand.wic.bmapfiles:sima-user@sima-user-machine:~$ scp simaai-image-minimal-modalix.rootfs.wic.* root@192.168.1.20:/tmp/ -
Write the image to the eMMC (
/dev/mmcblk0).For eLxr:
root@modalix:~# dd if=/tmp/elxr-palette-modalix-<version>-arm64.img of=/dev/mmcblk0 bs=4M status=progress conv=fsyncFor Yocto:
root@modalix:~# bmaptool copy /tmp/simaai-image-minimal-modalix.rootfs.wic.gz /dev/mmcblk0 -
Repair the partition table:
root@modalix:~# printf "fix\n" | parted ---pretend-input-tty /dev/mmcblk0 print
Step 3. Boot From eMMC
-
If you booted from the network, restore the default boot order:
sima$ env set boot_targets mmc1 mmc0 dhcp net; saveenvIf you booted from an SD card, remove it.
-
Reboot or power-cycle the board and confirm it boots from eMMC.
Next Steps
- Factory Build and Test: the full production flow, including board ID, MAC address, and diagnostics.
- Release Compatibility: which kernel and U-Boot commits make up each release.