Older mfgtools uses cfg.ini to store board configuration. If you have multiple boards or multiple configurations, you need to modify cfg.ini every time when there is a change. Recent mfgtools uses vbs file (VB Script) to specify board configuration and parameters. You can create multiple vbs files for different configurations and simply double click it to execute the flash process.
Frodo LDownload and extract the compressed file to see the full example.
Shou-Chien YIn this case, "SDCard-Android-IMX6Q-ar6mx" is the list name specified in the ucl2.xml file, and "mmc=2" is the parameter for mmcblk number. For current AR6MX device tree setting, mmc2 is for SD card and mmc3 is for eMMC.
<LIST name="SDCard-Android-IMX6Q-ar6mx" desc="Choose SD Card as media">
Shou-Chien Yucl2.xml is the file that describes the flash details such as the flash process and what files to use during the flash process. You can find the ucl2.xml file under mfgtools\Profiles\Linux\OS Firmware\, which all other file paths are related to.
The flash process consists of two stages. In the first stage, mfgtools loads necessary MFG files (u-boot, device tree, uImage, and initramfs) from your PC and boot the AR6MX board to kernel.
Shou-Chien YAfter the board successfully boot into kernel, the initramfs will wait for mfgtools to execute second stage commands, this includes partitioning/formating the storage device (SD/eMMC), flash u-boot and android images.
Shou-Chien Yu-boot will go to un-partitioned area at 1KB position. boot.img, recovery.img, and system.img will go to partition 1, 2, and 5. You can adjust partition size by modifying script`mksdcard-android.sh.tar`
Shou-Chien YIf you have your own custom android images that you wish to flash, please place them to mfgtools\Profiles\Linux\OS Firmware\files\android\ar6mx\ directory, and modify the ucl2.xml file accordingly if the image file location or file name is different from the original one states in ucl2.xml file.
If you wish to flash images to eMMC device, you will first need to modify the BoardConfig.mk file from android source code and change BUILD_TARGET_DEVICE = sd to BUILD_TARGET_DEVICE = emmc, then rebuild boot.img file. (deleting root folder from out directory may be required) This basically makes fstab look for mmcblk3 instead of mmcblk2.
Second, create another vbs file in mfgtools and change the mmc parameter to mmc=3. It is recommended to create another list name for eMMC flashing.
Shou-Chien YFlashing android images to eMMC is basically the same as flashing to SD card, but there is one difference while flashing u-boot. eMMC has a write protection bit for the boot sector, so you will need to unlock it before flashing u-boot, then lock it again after u-boot has been flashed.