Skip to content

Flashing NAND

Engicam provides shell scripts to program each NAND partition individually.
The scripts are included via the Yocto recipe engicam-mtd-script from meta-engicam-nxp.

NAND applies to i.MX6ULL modules

NAND flashing is primarily used on imx6ull-microgea with the Microdev 3.0 carrier board.


Prerequisites

Build the BSP and locate the deploy directory:

build/tmp/deploy/images/<machine>/

Collect the following files:

Component File
U-Boot u-boot.imx
Kernel zImage
Device Tree <machine>.dtb
Root Filesystem rootfs.tar.bz2

Copy them to a bootable SD card or USB stick. Boot the board from SD to access the scripts.

Warning

Verify NAND partition device nodes (/dev/mtd*) before flashing.
Writing to the wrong partition can permanently corrupt the board.


Flash U-Boot

prboot.sh u-boot.imx

Writes U-Boot to /dev/mtd0 using kobs-ng. Do not interrupt this step.


Flash the Kernel

prkernel.sh zImage

Erases /dev/mtd1 and writes the kernel image.


Flash the Device Tree

prdtb.sh <machine>.dtb

Writes the DTB to /dev/mtd2.

Example

prdtb.sh microgea.mx6ull.dtb

Flash the Root Filesystem

prfs.sh rootfs.tar.bz2

This script:

  1. Formats /dev/mtd3 with UBI.
  2. Attaches the UBI volume.
  3. Creates a volume named rootfs.
  4. Mounts the UBI filesystem.
  5. Extracts the root filesystem tarball.
  6. Syncs data to NAND.

Warning

Ensure the root filesystem archive matches the UBI layout of your target board.


Flashing via TFTP

For lab or automated environments, Engicam provides TFTP-based scripts.

Set Up the TFTP Server

Place files in the TFTP root directory with these exact names:

/tftpboot/u-boot.imx
/tftpboot/zImage
/tftpboot/zImage.dtb
/tftpboot/rootfs.tar.bz2

Set the Server IP

export serverip=192.168.2.60

Verify connectivity:

tftp $serverip -c get zImage

Run the TFTP Scripts

Script Action
tftp_boot.sh Flash U-Boot via TFTP
tftp_kernel.sh Flash kernel via TFTP
tftp_fs.sh Flash root filesystem via TFTP
./tftp_boot.sh
./tftp_kernel.sh
./tftp_fs.sh