RE: [EXT] Re: fw_printenv resulting in bad crc, using default environment

2020-02-05 Thread Robert Varga
Hi Anatolij,

Thank you very much for solving the problem. After commenting out the line 
within /etc/fw_env.config the fw_printenv tool now works as expected.

Regards,
Robert

-Original Message-
From: Anatolij Gustschin [mailto:ag...@denx.de]
Sent: Wednesday, February 05, 2020 3:03 PM
To: Robert Varga
Cc: u-boot@lists.denx.de
Subject: [EXT] Re: fw_printenv resulting in bad crc, using default environment

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


On Wed, 5 Feb 2020 10:09:40 +
Robert Varga robert.va...@getinge.com wrote:
...
> The content of /etc/fw_env.config is as follows:
> cat /etc/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.

The above statement is a hint.

> # Notice, that the "Number of sectors" is ignored on NOR and SPI-dataflash.
> # Futhermore, if the Flash sector size is ommitted, this value is assumed to
> # be the same as the Environment size, which is valid for NOR and 
> SPI-dataflash
>
> # THIS IS VALID FOR TQMa6x eMMC-card only!
> # eMMC Block device access
> /dev/mmcblk00x100x2000
> # if using with redundant env
> /dev/mmcblk00x102x2000

Comment out the above line and try again.

...
> hexdump -C -s 0x10 -n 8192 /dev/mmcblk0
> 0010  95 fc 63 38 61 64 64 63  6d 61 3d 73 65 74 65 6e  |..c8addcma=seten|
> 00100010  76 20 62 6f 6f 74 61 72  67 73 20 24 7b 62 6f 6f  |v bootargs ${boo|

It looks like this U-Boot configuration does not use redundant environment,
so you must have only one entry in /etc/fw_env.config.

--
Anatolij
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to which they are addressed. If 
you have received this email in error please notify the system manager. This 
message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail by mistake and delete 
this e-mail from your system. If you are not the intended recipient you are 
notified that disclosing, copying, distributing or taking any action in 
reliance on the contents of this information is strictly prohibited.


fw_printenv resulting in bad crc, using default environment

2020-02-05 Thread Robert Varga
Hello,

I am using a Linux evaluation board MBa6x with the TQMa6x module. The system is 
configured in order to boot from eMMC. I would like to use the tool fw_printenv 
and get following result:

fw_printenv
Warning: Bad CRC, using default environment
bootargs=
bootcmd=
bootdelay=2
baudrate=115200
...

The content of /etc/fw_env.config is as follows:
cat /etc/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 ignored on NOR and SPI-dataflash.
# Futhermore, if the Flash sector size is ommitted, this value is assumed to
# be the same as the Environment size, which is valid for NOR and SPI-dataflash

# THIS IS VALID FOR TQMa6x eMMC-card only!
# eMMC Block device access
/dev/mmcblk00x100x2000
# if using with redundant env
/dev/mmcblk00x102x2000
...

As a first action, I interrupted the boot process to enter the u-boot shell. 
Within the u-boot shall I forced to re-write the environment variables by using 
the command saveenv. This seems to work without any issues.
=> saveenv
Saving Environment to MMC...
Writing to MMC(0)... done

But next time, when the system reboots, the fw_printenv command issues the same 
result as described above (Bad CRC...).
Next action I have done is to dump the content of the memory at address 
0x10, which seems to be ok.

hexdump -C -s 0x10 -n 8192 /dev/mmcblk0
0010  95 fc 63 38 61 64 64 63  6d 61 3d 73 65 74 65 6e  |..c8addcma=seten|
00100010  76 20 62 6f 6f 74 61 72  67 73 20 24 7b 62 6f 6f  |v bootargs ${boo|
...

A hexdump at address 0x102000 seems to be incorrect. Maybe this is the root 
cause of the bad CRC issue?
hexdump -C -s 0x102000 -n 8192 /dev/mmcblk0
00102000  18 00 9f e5 95 24 01 eb  3c 30 94 e5 04 00 a0 e1  |.$..<0..|
00102010  08 30 43 e2 3c 30 84 e5  80 ff ff eb 7b ff ff eb  |.0C.<0..{...|
...

Here is also the output of /dev

ls /dev
...
cuse  memory_bandwidthstdout
disk   mmcblk0   tty
dri mmcblk0boot0 ttymxc1
fd  mmcblk0boot1 ttymxc2
fullmmcblk0p1   ttymxc3
fuse  mmcblk0p2   ttymxc4
gpiochip0mmcblk0p3   ubi_ctrl
gpiochip1mmcblk0rpmb  uhid
gpiochip2mmcblk1   uinput
gpiochip3mmcblk1p1   urandom
gpiochip4mmcblk1p2   v4l
gpiochip5mmcblk1p3   vga_arbiter
gpiochip6mqueue video0
...

Thank you for any hints you could provide in order to solve this issue.

Regards,
Robert Varga

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to which they are addressed. If 
you have received this email in error please notify the system manager. This 
message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail by mistake and delete 
this e-mail from your system. If you are not the intended recipient you are 
notified that disclosing, copying, distributing or taking any action in 
reliance on the contents of this information is strictly prohibited.