Changes between Version 40 and Version 41 of newport


Ignore:
Timestamp:
02/08/2018 09:57:56 PM (6 years ago)
Author:
Tim Harvey
Comment:

update firmware-update and recovery sections

Legend:

Unmodified
Added
Removed
Modified
  • newport

    v40 v41  
    146146The various items that can be updated:
    147147 * GSC Firmware - currently only JTAG updates are supported for Newport - see [#jtag-gsc below]
    148  * Boot Firmware (Everything up to and including the Bootloader) - currently must be updated from U-Boot or Linux on a live system - see [#firmware-update-uboot below]
    149  * Root Filesystem (Operating System) - currently must be updated from U-Boot or Linux on a live system - see [#firmware-update-uboot below]
     148 * Boot Firmware (Everything up to and including the Bootloader) - currently must be updated from U-Boot or Linux on a live system - see [#serial-ethernet below]
     149 * Root Filesystem (Operating System) - currently must be updated from U-Boot or Linux on a live system - see [#serial-ethernet below]
    150150
    151151
     
    154154The quickest and easiest way to update your firmware is via Serial Console and Ethernet. You can do this either in the U-Boot bootloader (recommended) or within a Linux OS. If your primary boot device is corrupt, then you can boot via an alternate boot device (ie microSD).
    155155
     156
     157[=#serial-ethernet-uboot]
     158=== Update Firmware via Serial Console and Ethernet from Bootloader ==
    156159If using U-Boot (recommended) you need to setup a TFTP server to host the files for transfer. Alternatively you could load firmware files from removable storage (microSD, mSATA, or USB for example) however the transfer rate is typically very slow compared to Gigabit Ethernet. For details on setting up a TFTP server see [wiki:tftpserver here].
    157160
    158161The following instructions assume your board target IP address is 192.168.1.1 and you have a TFTP server at 192.168.1.146. Adjust environment according to your network via 'setenv ipaddr <ipaddr>' and 'setenv serverip <serverip>'.
    159162
    160 Note that if booted from the eMMC (primary device) U-Boot mmc dev 0 is eMMC and mmc dev 1 is microSD however if you booted from the microSD (secondary device) then U-Boot mmc dev 0 is microSD and mmc dev 1 is eMMC. Be sure to use {{{mmc list}}} to determine which device you should set via the {{{mmc dev}}} command.
    161 
    162 To update just the 'firmware' (everything up to and including the Bootloader) ([https://github.com/Gateworks/images-newport/raw/master/firmware-newport.img firmware image]):
    163 {{{#!bash
    164 mmc dev 0 # use 'mmc list' to show which device is which and select eMMC
    165 tftpboot ${loadaddr} firmware-newport.img && mmc write ${loadaddr} 0 8000
    166 }}}
    167 
    168 To update the 'boot firmware' as well as the root filesystem download the latest xenial-newport.img.gz from [https://github.com/Gateworks/images-newport/releases/latest the latest release] and flash with:
    169 {{{#!bash
    170 mmc list # see which device is emmc vs sd
    171 setenv dev 0 # use device of emmc assuming booted from emmc
    172 # using tftp server
     163Note that the {{{dev}}} variable needs to be set to the MMC device you are updating:
     164 * setenv dev 0 # boot device
     165 * setenv dev 1 # secondary device
     166 * use {{{mmc list}}} to see how they are configured
     167
     168Examples:
     169 * Update just the '[wiki:newport/boot boot firmware]' (everything up to and including the Bootloader) ([https://github.com/Gateworks/images-newport/raw/master/firmware-newport.img firmware image]):
     170{{{#!bash
     171setenv dev 0 # use 'mmc list' to show which device to use for eMMC vs microSD
     172tftpboot ${loadaddr} firmware-newport.img && mmc write ${loadaddr} 0 8000 # update first 16MB
     173}}}
     174 * Update the entire device from a Compressed Disk Image ('[wiki:newport/boot boot firmware]' as well as OS):
     175{{{#!bash
     176setenv dev 0 # use 'mmc list' to show which device to use for eMMC vs microSD
    173177tftpboot ${loadaddr} xenial-newport.img.gz && gzwrite mmc ${dev} ${loadaddr} ${filesize}
    174178}}}
    175  * after booting to Linux you will want to run {{{resize2fs /dev/mmcblk0p2}}} to resize the partition to expand to the available space. This is because {{{xenial-newport.img.gz}}} is a compressed disk image created with a minimal root filesystem to keep flashing time down to a minimum for fast updates.
    176 
    177 [=#microsd]
     179  - If using Ubuntu you will want to run {{{resize2fs /dev/mmcblk0p2}}} to resize the partition to expand to the available anytime after the first. This is because {{{xenial-newport.img.gz}}} is a compressed disk image created with a minimal root filesystem to keep flashing time down to a minimum for fast updates.
     180
     181
     182[=#recovery]
    178183== Creating a microSD recovery image ==
    179184If your primary boot won't boot for some reason (ie, you corrupted it during development) you can boot from a microSD (see [#bootdevice here]).
     
    186191}}}
    187192  - '''Be careful to set the DEVICE above to the device the microSD appears as on your Linux host - you do not want to overwrite part of your hosts filesystem'''
    188  * On a Newport board booted from eMMC:
     193 * On a Newport board booted from eMMC from U-Boot:
    189194{{{#!bash
    190195mmc list # if booted from eMMC you should see microSD as dev 1
     
    192197tftpboot ${loadaddr} firmware-newport.img && mmc write ${loadaddr} 0 8000
    193198}}}
    194 
    195 To create a bootable microSD with the Gateworks Ubuntu image (takes longer):
    196  * On a Linux host:
    197 {{{#!bash
    198 DEVICE=/dev/sdc # set to the microSD on your host
    199 zcat xenial-newport.img.gz | sudo dd of=$DEVICE
    200 # re-partition with a 2.5MB DOS partition (required by BDK) and a Linux partition at 16MB
    201 printf "3072,8191,1,,\n32768,,L,,\n" | sudo sfdisk -uS $DEVICE
    202 }}}
    203   - we re-partition so that the full size of your microSD is available as the firmware image has partitions setup for a 8GiB device. Even though the partition table grows to the size of your device you still need to run {{{resize2fs /dev/mmcblk0p2}}} after bootup to grow the partition to fit the space in the table.
    204   - while you could use U-Boot on a running board to program a microSD you would not be able to adjust it's partition table easily to take advantage of a larger disk.
    205199
    206200