Changes between Version 30 and Version 31 of linux/ubi


Ignore:
Timestamp:
08/18/2020 07:45:26 PM (4 years ago)
Author:
Cale Collins
Comment:

moved split image below ubifs section so note reads correctly.

Legend:

Unmodified
Added
Removed
Modified
  • linux/ubi

    v30 v31  
    575575'''Note that operating on the ubi device as described here destroys the wear-leveling information contained in the UBI therefore it is recommended to work at the ubi volume layer to replace ubifs volumes as described below'''
    576576
    577 [=#SplitMethod]
    578 ==== Updating UBI with low RAM devices
    579 For some devices, the size of the NAND flash exceeds the size of RAM. In this scenario the instructions from the prior section would fail as you would run out of RAM space before you could finish retrieving the file to program the NAND flash with.
    580 
    581 To work around this limitation Gateworks has created an installable U-Boot script that will apply UBI files containing a single partition image. This can be particularly useful for updating the firmware of a running target.
    582 
    583 To update using a split UBI:
    584  '''1. Split your UBI
    585   In some situations the RAM of your device will be smaller than the image file required to update your system, therefore it is necessary to split the image file and apply the resulting compressed parts in a piece wise update. The below example uses the {{{split}}} command to split the input file into parts that are reasonably smaller than the RAM size of the board which will be consuming the update.
    586  {{{#!bash
    587 FILE=xenial-large.ubi
    588 # Split file every 200M with suffix ".part" and decimal increment
    589 split -d -b 200M ${FILE} ${FILE}.part
    590 
    591 # Result will be multiple files such as xenial-large.ubi.partXX that are <= 200M and
    592 # which adhere to the naming convention required by the script (ends with .partXX in sequential order)
    593 }}} 
    594  '''2. Install the U-Boot script
    595   On the target machine, source the [http://trac.gateworks.com/raw-attachment/wiki/linux/ubi/nand_split_update.scr nand_split_update.scr] U-Boot script attached to this page (or copy its contents with an editor). For example via tftp:
    596 {{{#!bash
    597 setenv serverip 192.168.1.100
    598 tftpboot nand_split_update.scr
    599 source $loadaddr
    600 }}}
    601  '''3. Configure your U-Boot environment
    602   From the script's usage:
    603 {{{
    604 The following environment variables need to be set in order for this script to run:
    605 
    606     splitfile    - full path file name prefix of the split files (eg file.ubi for file.ubi.part00)
    607 }}}
    608   An example configuration:
    609 {{{#!bash
    610 setenv splitfile xenial-large.ubi          # ubi file from example above
    611 }}}
    612 
    613  '''4. Run the added script with {{{run nand_split_update}}}
    614 
    615 
    616 
    617577
    618578[=#uboot-ubifs]
     
    633593
    634594Use the information in the section above for examples on how to load data in uboot from various sources such as network, mmc, usb.
     595[=#SplitMethod]
     596=== Updating UBI with low RAM devices
     597For some devices, the size of the NAND flash exceeds the size of RAM. In this scenario the instructions from the prior section would fail as you would run out of RAM space before you could finish retrieving the file to program the NAND flash with.
     598
     599To work around this limitation Gateworks has created an installable U-Boot script that will apply UBI files containing a single partition image. This can be particularly useful for updating the firmware of a running target.
     600
     601To update using a split UBI:
     602 '''1. Split your UBI
     603  In some situations the RAM of your device will be smaller than the image file required to update your system, therefore it is necessary to split the image file and apply the resulting compressed parts in a piece wise update. The below example uses the {{{split}}} command to split the input file into parts that are reasonably smaller than the RAM size of the board which will be consuming the update.
     604 {{{#!bash
     605FILE=xenial-large.ubi
     606# Split file every 200M with suffix ".part" and decimal increment
     607split -d -b 200M ${FILE} ${FILE}.part
     608
     609# Result will be multiple files such as xenial-large.ubi.partXX that are <= 200M and
     610# which adhere to the naming convention required by the script (ends with .partXX in sequential order)
     611}}} 
     612 '''2. Install the U-Boot script
     613  On the target machine, source the [http://trac.gateworks.com/raw-attachment/wiki/linux/ubi/nand_split_update.scr nand_split_update.scr] U-Boot script attached to this page (or copy its contents with an editor). For example via tftp:
     614{{{#!bash
     615setenv serverip 192.168.1.100
     616tftpboot nand_split_update.scr
     617source $loadaddr
     618}}}
     619 '''3. Configure your U-Boot environment
     620  From the script's usage:
     621{{{
     622The following environment variables need to be set in order for this script to run:
     623
     624    splitfile    - full path file name prefix of the split files (eg file.ubi for file.ubi.part00)
     625}}}
     626  An example configuration:
     627{{{#!bash
     628setenv splitfile xenial-large.ubi          # ubi file from example above
     629}}}
     630
     631 '''4. Run the added script with {{{run nand_split_update}}}
     632
    635633
    636634