Changes between Version 18 and Version 19 of OpenWrt/building


Ignore:
Timestamp:
05/21/2019 11:50:27 PM (5 months ago)
Author:
Tim Harvey
Comment:

added example of creating a disk image for MMC

Legend:

Unmodified
Added
Removed
Modified
  • OpenWrt/building

    v18 v19  
    213213Creating JTAG Binaries to flash with the GW16042 is easily done with the targets in the makefile within the gateworks directory:
    214214{{{#!bash
    215 # Make a 'jtagable' images for Ventana
     215# Make a 'jtagable' images for Ventana NAND FLASH
    216216make -C gateworks/ images/ventana
    217217
    218 # Make a 'jtagable' image for Laguna
     218# Make a 'jtagable' image for Laguna NOR FLASH
    219219make -C gateworks/ images/laguna
    220220
     
    222222make -C gateworks/ images
    223223}}}
    224 
    225 The resulting flash firmware image will be {{{gateworks/images/}}}.
     224 * The resulting flash firmware image will be {{{gateworks/images/}}}.
     225
     226If you wish to create an MMC 'disk image' for Ventana boards that boot from eMMC:
     227{{{#!bash
     228# create an ext4 filesystem image (using mkfs from Newport BSP)
     229OUT=owrt.ext4
     230SIZEMB=256M # adjust this larger if bootfs.tar.gz and rootfs.tar.gz don't fit
     231wget https://raw.githubusercontent.com/Gateworks/bsp-newport/master/mkfs
     232chmod +x mkfs
     233sudo mkfs ext4 $OUT $SIZEMB bin/imx6/gateworks-imx6-ventana-bootfs.tar.gz bin/imx6/gateworks-imx6-ventana-rootfs.tar.gz
     234
     235# create a filesystem image
     236OUTFS=owrt.ext4
     237SIZEMB=256M
     238MNT=$(mktemp -d -p/tmp)
     239truncate -s $SIZEMB $OUTFS
     240sudo mkfs.ext4 -q -F -O ^64bit -L rootfs $OUTFS
     241sudo mount $OUTFS $MNT
     242sudo tar -C $MNT -xf bin/imx6/gateworks-imx6-ventana-bootfs.tar.gz
     243sudo tar -C $MNT -xf bin/imx6/gateworks-imx6-ventana-rootfs.tar.gz
     244sudo umount $MNT
     245
     246# create a disk image
     247OUTIMG=ventana_emmc.img
     248truncate -s 1M $OUTIMG
     249# partition disk - single ext partition
     250printf ",,L,,\n" | sudo sfdisk -uS $OUTIMG
     251sudo dd if=ventana/images/SPL of=$OUTIMG bs=512 seek=2
     252sudo dd if=ventana/images/u-boot.img of=$OUTIMG bs=512 seek=138
     253sudo dd if=$OUTFS of=$OUTIMG bs=1M seek=1
     254
     255# create a jtag binary image
     256mkimage_jtag --emmc -e --partconf=user $OUTIMG@user:erase_all:0x0- > $OUTIMG.bin
     257
     258# create a compressed disk image that can be installed via U-Boot's gzwrite
     259gzip -f -k $OUTIMG && ls -lh $OUTIMG*
     260}}}
     261 * ventana_emmc.img is a non-compressed disk image containing SPL, U-Boot and the ext4 partition which can be copied directly to a microSD or eMMC
     262 * ventana_emmc.bin is a JTAG'able binary image containing SPL, U-Boot and the ext4 partition
     263 * ventana_emmc.img.gz is a compressed disk image which can be updated via U-Boot for example with a 'gzwrite mmc $dev $loadaddr $filesize'
    226264
    227265To flash the file to the board, please see this link: [wiki:jtag_instructions#Instructions JTAG Programming Instructions]