mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Boulais, Marc-Andre" <maboulais@rheinmetall.ca>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: RE: saveenv & erase with bad blocks present
Date: Fri, 6 Feb 2015 17:03:59 +0000	[thread overview]
Message-ID: <29A2697B0516A946B1023D5E798DFCF67BAB72A5@mail-ying> (raw)
In-Reply-To: <20150205212335.GF12209@pengutronix.de>

Ok, I did erase the nand0.bareboxenv partition and after a reset, partition size for the env looks good: 
barebox@Phytec phyCORE-OMAP4460:/ ls /dev/nand0.bareboxenv* -l
crw-------     131072 /dev/nand0.bareboxenv.bb   
crw-------     131072 /dev/nand0.bareboxenv 
barebox@Phytec phyCORE-OMAP4460:/ loadenv -d -s
loading environment from defaultenv
barebox@Phytec phyCORE-OMAP4460:/ saveenv
saving environment

So I can now save the environment without errors. But if I edit the config file and then do "saveenv" and then I reset, my changes are not there anymore as if the saveenv didn't work.

Furthermore, I have this message " wrong crc on env superblock" that appears  in the boot output...
What do you think ?

Thanks for your help,
Marc-Andre



barebox 2015.02.0-dirty #6 Fri Feb 6 11:44:51 EST 2015


Board: Phytec phyCORE-OMAP4460
i2c-omap i2c-omap40: bus 0 rev0.11 at 100 kHz
omap-hsmmc omap4-hsmmc0: registered as omap4-hsmmc0
mci0: detected SD card version 2.0
mci0: registered disk0
smc911x smc911x0: LAN911x identified, idrev: 0x92210000, generation: 4
mdio_bus: miibus0: probed
eth0: got preset MAC address: 50:2d:f4:05:65:82
nand: ONFI param page 0 valid
nand: ONFI flash detected
nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xb3 (Micron MT29F8G16ADBDAH4), 1024MiB, page size: 2048, OOB size: 64
omap_fb omap_fb: HW-Revision 0x0040 0x0040
omap_fb omap_fb: registered
malloc space: 0x8d000000 -> 0x8effffff (size 32 MiB)
BCH decoding failed
wrong crc on env superblock
running /env/bin/init...



-----Original Message-----
From: Sascha Hauer [mailto:s.hauer@pengutronix.de] 
Sent: February-05-15 4:24 PM
To: Boulais, Marc-Andre
Cc: barebox@lists.infradead.org
Subject: Re: saveenv & erase with bad blocks present

On Thu, Feb 05, 2015 at 07:09:51PM +0000, Boulais, Marc-Andre wrote:
> Sascha,
> I have installed the patches and tried erasing the environment with the nand0.erasebad flag. I am now able to execute the erase command on the nand device bareboxenv.bb without errors but I noticed its length is set to zero length....and finally, command "saveenv" still fails. Here's my output:
> ...
> barebox@Phytec phyCORE-OMAP4460:/ ls -l /dev/nand*
> crw------- 1064566784 /dev/nand0.root.bb
> crw------- 1064566784 /dev/nand0.root
> crw-------    4194304 /dev/nand0.splash.bb
> crw-------    4194304 /dev/nand0.splash
> crw-------    4194304 /dev/nand0.kernel.bb
> crw-------    4194304 /dev/nand0.kernel
> crw-------          0 /dev/nand0.bareboxenv.bb               <-------- This does not look good...

This is because the nand bb driver calculates the usable size of the partition. Here the size is 0 because the block is marked as bad due to writing it with the erroneous nand driver.

> crw-------     131072 /dev/nand0.bareboxenv
> crw-------     524288 /dev/nand0.barebox.bb
> crw-------     524288 /dev/nand0.barebox
> crw-------     131072 /dev/nand0.xload.bb
> crw-------     131072 /dev/nand0.xload
> cr--------   33554432 /dev/nand_oob0
> crw------- 1073610752 /dev/nand0.bb
> crw------- 1073741824 /dev/nand0
> barebox@Phytec phyCORE-OMAP4460:/ unprotect /dev/nand0.bareboxenv.bb 
> barebox@Phytec phyCORE-OMAP4460:/ nv nand0.erasebad=1

Ok, now you can erase bad blocks,

> barebox@Phytec phyCORE-OMAP4460:/ erase /dev/nand0.bareboxenv.bb

but the bb device skip the bad blocks, so this does effectively nothing.
Use /dev/nand0.bareboxenv (without the bb) instead. Restart barebox afterwards so that the size of the bb device gets recalculated.

> 
> I also have this " No renderer found for filetype UBI image"  error in 
> the startup messages, I am not sure it is related, but probably it's 
> the next thing I need to figure out...I have included the startup 
> messages right after my signature.

The phycore startup script contains a splash command which works directly on a Nand partition. For some reason this partition contains an mtd UBI image. This could be because you wrote it there or because the partition offsets are shifted so that the splash partition is now where your rootfs has been before.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-02-06 17:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 16:38 Boulais, Marc-Andre
2015-02-03 19:52 ` Uwe Kleine-König
2015-02-03 20:11 ` Sascha Hauer
2015-02-03 20:44   ` Boulais, Marc-Andre
2015-02-05 10:16     ` Sascha Hauer
2015-02-05 19:09       ` Boulais, Marc-Andre
2015-02-05 21:23         ` Sascha Hauer
2015-02-06 17:03           ` Boulais, Marc-Andre [this message]
2015-02-09  7:18             ` Sascha Hauer
2015-02-09 13:37               ` Boulais, Marc-Andre
2015-02-10  9:20                 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29A2697B0516A946B1023D5E798DFCF67BAB72A5@mail-ying \
    --to=maboulais@rheinmetall.ca \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox