[U-Boot-Users] make env

Manuel Sahm
2008-03-25T12:56:38Z

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.
>
>