From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manuel Sahm Date: Tue, 25 Mar 2008 17:19:17 +0100 Subject: [U-Boot-Users] make env In-Reply-To: <87fxufc4cx.fsf@denx.de> References: <20080320201156.GA22544@michl.2n.cz> <20080320212718.1954D24A8B@gemini.denx.de> <20080320213357.GA22780@michl.2n.cz> <47E8F686.9020903@feig.de> <87fxufc4cx.fsf@denx.de> Message-ID: <47E92605.2080808@feig.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, but why is there a error concerning NAND flashs if only NOR flashs are supported ? "nand_write: attempting to write not page aligned data" Thank you Manuel Sahm Markus Klotzb?cher schrieb: > Hi Manuel, > > Manuel Sahm writes: > > >> I took the U-Boot version 1.3.2; now I am able to generate the make env >> -> fw_printenv utility. >> >> I copy the jw_printenv binary and rename it to fw_setenv. >> > > A (hard) link would be enough. > > >> I use the config file in the /etc directory. >> I want to access a NAND flash. [Pagesize = 0x800; ERASEBLOCKSIZE=0x20000] >> My uboot is in mtd1. >> mtd1 is from 0x20000 ... 0x100000 in my NAND-Flash >> The Uboot enviroment is from 0x60000...0x80000; the redundant from >> 0x80000...0x100000 >> >> My fw_config file is: >> >> /dev/mtd1 0x40000 0x20000 0x20000 >> /dev/mtd1 0x60000 0x20000 0x20000 >> >> Is this correct ? >> > > Looks OK to me. > > >> I am able tu use fw_printenv, the variables are printed on the console >> If I use fw_setenv I get errors: >> >> fw_setenv test 1 >> >> Unlocking Flash >> Done >> nand_write: attempting to write not page aligned data >> Erasing old enviroment >> Done >> Writing enviroment to /dev/mtd1: Invalid argument >> Error: can?t write fw_env to flash >> >> What?s wrong ???? >> > > I think the problem is that the fw_setenv so far only supports NOR > flash. Environment in NAND is implemented slightly different, especially > it doesn't (and can't) invalidate the former valid environment after the > updated one was written successfully. So I'm afraid you will have to > update this tool to support NAND. > > Best regards > > Markus Klotzbuecher > > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de >