No access to U-Boot using Serial / Linux "fw_printenv" utility (After upgrade..)

Hi,

Earlier today I tried to upgrade my Yún U-Boot (Yes, of course it was a bad thing to do.)
The status for now is that I’m unable to access the U-boot prompt using the serial console (all I see is gibberish - see [ 1147.480000] in the attachment log file)

The bright side is that I have full access to Linux (SSH and Serial).

What I tried so far:

  1. Testing with all available bauds rates from 110 to 256K - No luck.
  2. Playing with “fw_printenv” -

My theory is that the content of /etc/fw_env.config file is correct and the U-boot environment flash “block” is full with junk, so somehow the U-Boot is booting the Linux without variables (Maybe it has some fallback/default variables).

I’ll highly appreciate if someone would be willing to share with me his /proc/mtd1 partition backup, a correct /etc/fw_env.config file, or any other suggestion.

Below is content of /etc/fw_env.config file and “fw_printenv” command output, my “input” for /etc/fw_env.config was based on /proc/mtd .

root@Arduino:/# 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.
# MTD device name       Device offset   Env. size       Flash sector size
/dev/mtd1               0x0000          0x10000         0x10000
root@Arduino:/# fw_printenv
Warning: Bad CRC, using default environment
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} i
p=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=5
baudrate=115200

Thanks.

ArduinoYunBootLogging.txt (12.3 KB)

If you are at hardware house, desolder smd flash chip (16MB) from board, copy pre-restore image into fresh smd flash chip with flash memory copier. resolder it back.

or

RMA

Hi,

Re-soldering of the flash will be the last resort, especially because the Atheros & ATmega processors are up and running.

I think that my original request (backup of the /proc/mtd1 partition -or- working /etc/fw_env.config file) should solve my “gibberish” U-Boot console.

My yun doesn't have one. I'd gladly send it if I could

Stephen@Arduino:/etc$ ls f*
firewall.user  fstab          functions.sh

Will it be possible to send U-Boot environment variables ? (That's the output of 'fw_printenv' ..)

Thanks.

netsan: Will it be possible to send U-Boot environment variables ? (That's the output of 'fw_printenv' ..)

root@Yun1:~# fw_printenv
Cannot parse config file: No such file or directory

:(

:-)

What about getting them from the U-Boot console itself? (I think 'printenv' is the relevant command..)

netsan: What about getting them from the U-Boot console itself? (I think 'printenv' is the relevant command..)

U-Boot 1.1.4-dirty (Apr 10 2014 - 15:12:15)

Arduino Yun (ar9331) U-boot

DRAM:  64 MB
Top of RAM usable for U-Boot at: 84000000
Reserving 142k for U-Boot at: 83fdc000
Reserving 192k for malloc() at: 83fac000
Reserving 44 Bytes for Board Info at: 83fabfd4
Reserving 36 Bytes for Global Data at: 83fabfb0
Reserving 128k for boot params() at: 83f8bfb0
Stack Pointer at: 83f8bf98
Now running in RAM - U-Boot at: 83fdc000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16777216, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ag7240_enet_initialize...
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
: cfg1 0x5 cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
eth0 up
: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0b:ad
athrs26_reg_init_lan
ATHRS26: resetting s26
ATHRS26: s26 reset done
eth1 up
eth0, eth1
Hit any key to stop autoboot:  0
ar7240> printenv
bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),14656k(rootfs),1280k(uImage),64k(NVRAM),64k(ART)
bootcmd=bootm 0x9fea0000
bootdelay=4
baudrate=115200
ethaddr=0xb4:0x21:0x8a:0x00:0x00:0x10
ipaddr=192.168.1.2
serverip=192.168.1.1
stdin=serial
stdout=serial
stderr=serial
ethact=eth0

Environment size: 360/65532 bytes
ar7240>

@netsan,
Me thinks there is more to the story. So, personally I would do PLAN A, as suggested by SonnyYu.

Jesse

sonnyyu:
If you are at hardware house, desolder smd flash chip (16MB) from board, copy pre-restore image into fresh smd flash chip with flash memory copier. resolder it back.

or

RMA

Jesse,

Can you please share more details about your theory?

Since U-Boot is able to boot Linux and even ATmega processor able to handle sketches, it seems to me that U-Boot is totally functional and there is no need to involve external hardware. The only thing that's not working as it should - is the U-Boot serial console, and from the logs I can assume that the only thing not functioning properly is the Baud rate.

netsan: Jesse,

Can you please share more details about your theory?

::::SNIP::::

@netsan, you keep making assumption about how the software works.

google: openwrt fw_printenv

Das U-Boot Environment

Next, using a configuration file (/etc/fw_env.config) with uboot is not standard. It does not ship with a factory Yun, and it is not installed after an upgrade.

So, there is more to this story than you are telling us.

Jesse

Jesse,

Of course working with /etc/fw_env.config is standard, otherwise fw_printenv wouldn’t be part of the Yún SW.
The fw_env.config only “point” to the right flash partition where U-Boot stores the environment variables.

After pointing to the right partition, you can print the variables (fw_printenv) or modify (fw_setenv).

I’m not sure why the cfg file is not shipped but the U-Boot-Tools package is installed ← I guess this is a question to the platform folks.

netsan:
Of course working with /etc/fw_env.config is standard, otherwise fw_printenv wouldn’t be part of the Yún SW.
::::SNIP::::

Your logic is failing. As I have already stated you are making assumptions of the software.

Jesse