From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manuel Sahm Date: Tue, 25 Mar 2008 13:56:38 +0100 Subject: [U-Boot-Users] make env In-Reply-To: <20080320213357.GA22780@michl.2n.cz> References: <20080320201156.GA22544@michl.2n.cz> <20080320212718.1954D24A8B@gemini.denx.de> <20080320213357.GA22780@michl.2n.cz> Message-ID: <47E8F686.9020903@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, 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. 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 ? 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 ???? Thank you very much Manuel Sahm Ladislav Michl schrieb: > On Thu, Mar 20, 2008 at 10:27:18PM +0100, Wolfgang Denk wrote: > >> It's not fw_setenv specific. You would have to do the same when you >> cross-compile any other native Linux application code. The best >> approach would be to fix your toolchain. >> > > Well, any other applications compile just fine. This is needed only when > you are interfacing some kernel subsystem (MTD in this case) and need > its headers. Current approach needs one toolchain for compiling fw_setenv > with 2.4 kernel and another for 2.6 kernel while there is no technical > reason not to use very same toolchain for both. > > Best regards, > ladis > > PS. I'm just pointing to one minor difficulty, as I have no problem with > that. I only tried to guess where might be Manuel's problem once he > figure out MTD_VERSION variable. > >