This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMDSLCDK138: fw_printenv not able to read NAND flash parameters

Part Number: TMDSLCDK138
Other Parts Discussed in Thread: OMAP-L138

Hi,

We're using the OMAP-L138 LCDK dev board from TI.

Right now we're trying to change the U Boot parameters from Linux user space.

To do this the fw_printenv and fw_setenv will be used.

I found those executables in the Linux SDK from TI for the OMAP-L138 and put them in the file system of the target board.

I then modified the fw_env.config file to use NAND flash with a zero offset, and placed the config file at /etc/fw_env.config.

I also verified that the version of fw_printenv was compiled with the CONFIG_FILE defined because # ./fw_printenv -help produces a help menu with the below line in the help menu:

-c, --config         configuration file, default:/etc/fw_env.config

Through using # cat mtd0 I was able to see the parameters from U Boot in NAND flash too, so they are there.

However, when I run fw_printenv it declares that a checksum mismatch was encountered while reading the data, and then proceeds to output some default values for parameters and not the ones from NAND flash (I modified the boot delay to 5 seconds from 3 through U Boot so I'd know if it read the correct data or not).

I'm thinking it failed to read the data because I haven't configured the fw_env.config file correctly.

I will upload my fw_env.config file in another post.

Any help on the topic would be appreciated.

Ben

  • fw_env.config
    # Configuration file for fw_(printenv/setenv) utility.
    # Up to two entries are valid, in this case the redundant
    # environment sector is assumed present.
    # Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash.
    # Futhermore, if the Flash sector size is omitted, this value is assumed to
    # be the same as the Environment size, which is valid for NOR and SPI-dataflash
    # Device offset must be prefixed with 0x to be parsed as a hexadecimal value.
    
    # NOR example
    # MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
    #/dev/mtd1		0x0000		0x4000		0x4000
    #/dev/mtd2		0x0000		0x4000		0x4000
    
    # MTD SPI-dataflash example
    # MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
    #/dev/mtd5		0x4200		0x4200
    #/dev/mtd6		0x4200		0x4200
    
    # NAND example
    /dev/mtd0		0x0000		0x4000		0x20000			1
    
    # On a block device a negative offset is treated as a backwards offset from the
    # end of the device/partition, rather than a forwards offset from the start.
    
    # Block device example
    #/dev/mmcblk0		0xc0000		0x20000
    #/dev/mmcblk0		-0x20000	0x20000
    
    # VFAT example
    #/boot/uboot.env	0x0000          0x4000
    
    # UBI volume
    #/dev/ubi0_0		0x0		0x1f000		0x1f000
    #/dev/ubi0_1		0x0		0x1f000		0x1f000
    
    # UBI volume by name
    #/dev/ubi0:env		0x0		0x1f000		0x1f000
    #/dev/ubi0:env-redund	0x0		0x1f000		0x1f000
    

    This is the fw_env.config file being used.

  • Hi, Ben,

    I am not familiar with user space utility and these user space utilities are from Open Source. I would suggest you look for answers on internet which I will need to do the same to understand it and see how it works. There are many discussions on internet/Linux Forum on this topic. You may want to take a look at them and see which applies to your case. User space application/utility is not TI's support scope.

    Rex

  • Hi Rex,

    I was able to eventually figure it out.

    The config file wasn't correct as I suspected.

    I changed it to the below and now fw_printenv works:

    /dev/mtd0        0x0000        0x10000        0x800            20

    However, fw_setent gives me an Error 13 Permission denied error message.

    Ben