202 | | [=#ventana-images] |
203 | | === Creating jtagable images for Ventana === |
204 | | |
205 | | [https://youtu.be/i3G8sQlwzcU Click here for instructional video baised on this section, mkimage and jtag_usbv4 are demonstrated] |
206 | | |
207 | | In order to create a jtagable image for our Ventana family line, you can use our [http://dev.gateworks.com/ventana/images/mkimage_jtag mkimage_jtag] script which can be downloaded [http://dev.gateworks.com/ventana/images/mkimage_jtag here]. (You may need to chmod the mkimage_jtag script to make executable. Be sure it does not have any extension such as txt) The usage varies, depending on typical use cases. For example, you can create jtagable images that only update the bootloader without erasing all of NAND. You can also create jtagable images with both the bootloader and a ubi image which will erase all of nand. Below are several examples on how to use this script. Also note that the script outputs to std out, so in the examples below, we redirect it to a file. |
208 | | |
209 | | Necessary files: |
210 | | * [http://trac.gateworks.com/attachment/wiki/jtag_instructions/SPL SPL] |
211 | | * [http://trac.gateworks.com/attachment/wiki/jtag_instructions/u-boot.img u-boot.img] |
212 | | |
213 | | To update just the bootloader, create a jtagable image with just the two parts: |
214 | | {{{ |
215 | | $ ./mkimage_jtag SPL u-boot.img > uboot.bin |
216 | | }}} |
217 | | |
218 | | To update both the bootloader and rootfs (ubi) |
219 | | {{{ |
220 | | $ ./mkimage_jtag SPL u-boot.img openwrt-ventana-rootfs.ubi > image.bin |
221 | | }}} |
222 | | |
223 | | To update just the rootfs |
224 | | {{{ |
225 | | $ ./mkimage_jtag openwrt-ventana-rootfs.ubi > image.bin |
| 202 | [=#images] |
| 203 | === Creating jtagable binary images with mkimage_jtag |
| 204 | |
| 205 | [https://youtu.be/i3G8sQlwzcU Click here for instructional video based on this section, mkimage and jtag_usbv4 are demonstrated] |
| 206 | |
| 207 | In order to create a jtagable image for Newport and Ventana products, you need to use the {{{mkimage_jtag}}} script to create a binary file containing flash instructions and content used by the {{{jtag_usbv4}}} application. You can download the latest version of the script [http://dev.gateworks.com/ventana/images/mkimage_jtag here]: |
| 208 | {{{#!bash |
| 209 | wget http://dev.gateworks.com/ventana/images/mkimage_jtag |
| 210 | chmod +x mkimage_jtag |
| 211 | }}} |
| 212 | |
| 213 | The usage varies, depending on what you want to program, how, and where. For example, you can create images that only update the boot firmware without touching the rest of flash. In general you provide binary files and details on where to place them and what to erase. |
| 214 | |
| 215 | Notes: |
| 216 | - for eMMC you can specify the '--partconf <boot0|boot1|user>' option to instruct {{{jtag_usbv4}}} to set the eMMC register that specifies the hardware to boot from |
| 217 | - the {{{-s}}} option invokes the 'scripted' mode which allows you to specify multiple objects |
| 218 | - the {{{-e}}} option invokes the 'scripted' mode but also instructs {{{jtag_usbv4}}} to erase the entire part |
| 219 | - Because JTAG is extremely slow for large flash parts such as eMMC it is advised that you use JTAG just to flash the boot firmware then use the boot firmware to flash the remainder of the device |
| 220 | |
| 221 | Examples: |
| 222 | * Newport eMMC: |
| 223 | - update just the boot firmware and set the hardware partition: |
| 224 | {{{#!bash |
| 225 | ./mkimage_jtag --emmc -s --partconf=user firmware-newport.img@user:erase_part:0-16 > firmware-newport.bin |
| 226 | }}} |
| 227 | - update the boot firmware and set the hardware partition and erase the entire part: |
| 228 | {{{#!bash |
| 229 | ./mkimage_jtag --emmc -e --partconf=user firmware-newport.img@user:erase_all:0-16 > firmware-newport.bin |
| 230 | }}} |
| 231 | * Ventana NAND: (see wiki:ventana/bootloader#nand here for NAND flash map) |
| 232 | - update just the boot firmware (SPL and u-boot): |
| 233 | {{{#!bash |
| 234 | ./mkimage_jtag SPL u-boot.img > uboot.bin |
| 235 | }}} |
| 236 | - update just the rootfs (does not touch boot firmware): |
| 237 | {{{#!bash |
| 238 | ./mkimage_jtag openwrt-ventana-rootfs.ubi > image.bin |
| 239 | }}} |
| 240 | - update the boot firmware and the root filesystem (erases entire flash): |
| 241 | {{{#!bash |
| 242 | ./mkimage_jtag SPL u-boot.img openwrt-ventana-rootfs.ubi > image.bin |