Changes between Version 9 and Version 10 of ventana/bootloader


Ignore:
Timestamp:
11/29/2018 09:30:19 PM (6 years ago)
Author:
Cale Collins
Comment:

uboot env tools refresh, examples and clarification added.

Legend:

Unmodified
Added
Removed
Modified
  • ventana/bootloader

    v9 v10  
    484484}}}
    485485
     486* ''Booting rootfs from microSD does not necessarily constitute "NAND-less", env variables are still stored on NAND when NAND is present.''
     487
     488
     489
    486490It is important to realize the meaning of the '''Warning: Bad CRC, using default environment''' message. This means that the non-volatile env area is empty or corrupt (Note that this is the way Gateworks boards ship by default) and that the built-in env within U-Boot will be used.
    487491
    488492If you use {{{fw_setenv}}} on an environment in this state it will properly set the variable you specify and all other variables will continue to use their built-in default values within U-Boot. Essentially you are 'overriding' the defaults as you would expect.
     493
     494
     495==== Configuring u-boot-tools
     496A file defining where your environment is located must be present for u-boot-tools to work.  Without this file you will receive an error:
     497{{{#!bash
     498Cannot parse config file '/etc/fw_env.config': No such file or directory
     499}}}
     500Examples:
     501* Ventana booting from NAND
     502{{{#!bash
     503#Create config file
     504cat << EOF > /etc/fw_env.config
     505# device  offset size erasesize
     506/dev/mtd1 0x0 0x20000 0x40000
     507/dev/mtd1 0x80000 0x20000 0x40000
     508EOF
     509}}}
     510* Ventana MMC only
     511{{{#!bash
     512#Create config file
     513cat << EOF > /etc/fw_env.config
     514# device  offset size erasesize
     515/dev/mmcblk0 0xb1400 0x20000 0x20000
     516/dev/mmcblk0 0xd1400 0x20000 0x20000
     517EOF
     518}}}
     519* A file for building an image
     520{{{#!bash
     521#Create config file
     522cat << EOF > /working/fw_env.config
     523# device  offset size erasesize
     524envVentana.bin 0x00000 0x20000
     525envVentana.bin 0x20000 0x20000
     526EOF
     527}}}
     528
     529This will define the device being used, offset according to flash layout, size from flash map, and size of erase block (unless the device is a file).  Ventana U-boot environment is redundant hence two entries, both locations need their variables updated. 
     530
     531==== Usage example
     532
     533{{{#!bash
     534# display environment
     535fw_printenv
     536# set environment variable
     537fw_setenv foo bar #foo being variable name bar being value variable will be set to
     538#second example
     539fw_setenv ipaddr 192.168.1.10
     540#print single environment variable
     541fw_printenv foo
     542#second example
     543fw_printenv ipaddr
     544}}}
    489545
    490546