Re: [U-Boot] fw_(printenv/setenv) and serial console have different env variables

2014-04-13 Thread Suriyan Ramasami
On Sat, Apr 12, 2014 at 5:57 AM, Andrei Mihut andrei.mi...@gmail.com wrote:
 Greetings everyone,

 I stumbled over something worth telling.

 It started as the bad crc using defaults issue when I tried to use
 fw_printenv on my debian iconnect box. I tought it was the fw_env.config.
 it wasn't. After hours of researching and compiling from source and the
 whole lot of trouble shooting I took the chance to use fw_setenv.

 Bingo! it worked. Now fw_printenv gives me no bad crc and prints the
 variables including the new ones even after reboot.

My thoughts are that your u-boot is storing the env in a different
area than what your fw_env.config is pointing to in debian. Hence the
crc error. Of course you can get rid of the crc error by running
fw_setenv, as it just dumps the default env in the space defined in
the config file.

 NOW HERE IS THE ISSUE

 The env variables printed from linux don't show on the serial and viceversa.
 It looks like there are 2 sets of them. Needless to say that it's
 frustrating.

 Anyone has seen anything similar?

 ** printouts
 on the iconnect box 
 root@ico1:~# fw_printenv
 bootcmd=bootp; setenv bootargs root=/dev/nfs
 nfsroot=${serverip}:${rootpath}
 ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
 bootdelay=5
 baudrate=115200
 firsttest=firsttest1
 root@ico1:~# fw_setenv secondtest secondtest
 root@ico1:~# fw_printenv
 bootcmd=bootp; setenv bootargs root=/dev/nfs
 nfsroot=${serverip}:${rootpath}
 ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
 bootdelay=5
 baudrate=115200
 firsttest=firsttest1
 secondtest=secondtest
 root@ico1:~#
 iconnect

 on the serial console
 Environment size: 1633/131068 bytes
 iconnect =
 iconnect = version

 U-Boot 2013.10 (Mar 26 2014 - 18:44:17) Iomega iConnect
 arm-openwrt-linux-uclibcgnueabi-gcc (OpenWrt/Linaro GCC 4.8-2014.01 r40028)
 4.8.3
 GNU ld (GNU Binutils) 2.22
 iconnect =
 +++
 just in case last working
 iconnect = printenv
 arcNumber=2870
 baudrate=115200
 bootargs=console=ttyS0,115200 root=/dev/sda4 rootdelay=10
 bootargs_console=console=ttyS0,115200 root=/dev/sda4 rootdelay=10
 bootargs_root=root=/dev/mtdblock2 rootfstype=jffs2
 bootcmd=setenv bootargs $(bootargs_console); run bootcmd_usb;run
 preboot;bootm 0x0080
 bootcmd_usb=usb start; ext2load usb 0:1 0x0080 /uImageJmybuildiscsi
 bootdelay=10
 console=console=ttyS0,115200 panic=20
 download_kernel=mw $(loadaddr) 0x 0x30; fatload usb 0:1 $(loadaddr)
 $(kernel_name);
 download_rootfs=mw $(loadaddr) 0x 0x20; fatload usb 0:1 $(loadaddr)
 $(rootfs_name);
 ethact=egiga0
 ethaddr=00:D0:B8:0C:FE:6C
 filesize=2dc1b1
 flash_kernel=nand erase 0x10 0x40; nand write.e $(loadaddr)
 0x10 0x40;
 flash_rootfs=nand erase 0x50 0xfb0; nand write.e $(loadaddr)
 0x50 0x20;
 if_netconsole=ping $(serverip)
 ipaddr=10.243.1.239
 kernel_name=openwrt-kirkwood-uImage
 load_openwrt=setenv bootargs $(console) $(bootargs_root); nand read
 $(loadaddr) 0x10 0x40; bootm $(loadaddr)
 loadaddr=0x640
 machid=B36
 mainlineLinux=yes
 ncip=10.243.1.251
 preboot=run set_eth_parms if_netconsole set_netconsole start_netconsole
 rootfs_name=openwrt-kirkwood--jffs2-64k.img
 serverip=10.243.1.251
 set_eth_parms=mii write 0xb 0 3200
 set_netconsole=setenv ncip $(serverip); setenv bootdelay 10
 start_netconsole=setenv stdin nc; setenv stdout nc; setenv stderr nc;
 version; sleep 10;
 stderr=nc
 stdin=nc
 stdout=nc
 serial console

 /etc/fw_env.config 
 root@ico1:~# cat /etc/fw_env.config
 # Configuration file for fw_(printenv/saveenv) utility.
 # Up to two entries are valid, in this case the redundand
 # environment sector is assumed present.
 # MTD device name   Device offset   Env. size   Flash sector size
 # iomega iconnect
 /dev/mtd0   0xa 0x2 0x2
 root@ico1:~#
  /etc/fw_env.config

Here I see that Device offset is 0xa (which fw_printenv works
with), and looking at include/configs/iconnect.h CONFIG_ENV_OFFSET is
0x8. The sizes do match.
Hence, can you try to change fw_env.config to have a device offset of
0x8 and see if you get same envs?

Thanks
- Suriyan

 How do I merge this two?
 Thanks and regards.

 A.
 --
 ენდრიუ მე ქოხი اندريه ميهوت  אנדריי מיהו 安德魯 アンドルー Андрей  Михут אַנדרעי
 מיהוט اندرو میهو

 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] fw_(printenv/setenv) and serial console have different env variables

2014-04-12 Thread Andrei Mihut
Greetings everyone,

I stumbled over something worth telling.

It started as the bad crc using defaults issue when I tried to use
fw_printenv on my debian iconnect box. I tought it was the fw_env.config.
it wasn't. After hours of researching and compiling from source and the
whole lot of trouble shooting I took the chance to use fw_setenv.

Bingo! it worked. Now fw_printenv gives me no bad crc and prints the
variables including the new ones even after reboot.

NOW HERE IS THE ISSUE

The env variables printed from linux don't show on the serial and viceversa.
It looks like there are 2 sets of them. Needless to say that it's
frustrating.

Anyone has seen anything similar?

** printouts
on the iconnect box 
root@ico1:~# fw_printenv
bootcmd=bootp; setenv bootargs root=/dev/nfs
nfsroot=${serverip}:${rootpath}
ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=5
baudrate=115200
firsttest=firsttest1
root@ico1:~# fw_setenv secondtest secondtest
root@ico1:~# fw_printenv
bootcmd=bootp; setenv bootargs root=/dev/nfs
nfsroot=${serverip}:${rootpath}
ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=5
baudrate=115200
firsttest=firsttest1
secondtest=secondtest
root@ico1:~#
iconnect

on the serial console
Environment size: 1633/131068 bytes
iconnect =
iconnect = version

U-Boot 2013.10 (Mar 26 2014 - 18:44:17) Iomega iConnect
arm-openwrt-linux-uclibcgnueabi-gcc (OpenWrt/Linaro GCC 4.8-2014.01 r40028)
4.8.3
GNU ld (GNU Binutils) 2.22
iconnect =
+++
just in case last working
iconnect = printenv
arcNumber=2870
baudrate=115200
bootargs=console=ttyS0,115200 root=/dev/sda4 rootdelay=10
bootargs_console=console=ttyS0,115200 root=/dev/sda4 rootdelay=10
bootargs_root=root=/dev/mtdblock2 rootfstype=jffs2
bootcmd=setenv bootargs $(bootargs_console); run bootcmd_usb;run
preboot;bootm 0x0080
bootcmd_usb=usb start; ext2load usb 0:1 0x0080 /uImageJmybuildiscsi
bootdelay=10
console=console=ttyS0,115200 panic=20
download_kernel=mw $(loadaddr) 0x 0x30; fatload usb 0:1 $(loadaddr)
$(kernel_name);
download_rootfs=mw $(loadaddr) 0x 0x20; fatload usb 0:1 $(loadaddr)
$(rootfs_name);
ethact=egiga0
ethaddr=00:D0:B8:0C:FE:6C
filesize=2dc1b1
flash_kernel=nand erase 0x10 0x40; nand write.e $(loadaddr)
0x10 0x40;
flash_rootfs=nand erase 0x50 0xfb0; nand write.e $(loadaddr)
0x50 0x20;
if_netconsole=ping $(serverip)
ipaddr=10.243.1.239
kernel_name=openwrt-kirkwood-uImage
load_openwrt=setenv bootargs $(console) $(bootargs_root); nand read
$(loadaddr) 0x10 0x40; bootm $(loadaddr)
loadaddr=0x640
machid=B36
mainlineLinux=yes
ncip=10.243.1.251
preboot=run set_eth_parms if_netconsole set_netconsole start_netconsole
rootfs_name=openwrt-kirkwood--jffs2-64k.img
serverip=10.243.1.251
set_eth_parms=mii write 0xb 0 3200
set_netconsole=setenv ncip $(serverip); setenv bootdelay 10
start_netconsole=setenv stdin nc; setenv stdout nc; setenv stderr nc;
version; sleep 10;
stderr=nc
stdin=nc
stdout=nc
serial console

/etc/fw_env.config 
root@ico1:~# cat /etc/fw_env.config
# Configuration file for fw_(printenv/saveenv) utility.
# Up to two entries are valid, in this case the redundand
# environment sector is assumed present.
# MTD device name   Device offset   Env. size   Flash sector size
# iomega iconnect
/dev/mtd0   0xa 0x2 0x2
root@ico1:~#
 /etc/fw_env.config

How do I merge this two?
Thanks and regards.

A.
-- 
ენდრიუ მე ქოხი اندريه ميهوت  אנדריי מיהו 安德魯 アンドルー Андрей  Михут אַנדרעי
מיהוט اندرو میهو
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot