
Hello,
I'm not sure this is the right mailing list so please tell me !
I am trying to develop a program that would check into some flash memory information (set early on by a userspace application) to know on which kernel and which partition it has to boot on.
I am trying a standalone application not sure that it is the more appropriate because of compilation problems.
I would like to have your advise before going any further ! Thanks a lot
Maxime

Dear Maxime Boure,
In message AANLkTim63RLGst8TM2MNkhFThz13RP7wiIqdy5MAuFc1@mail.gmail.com you wrote:
I'm not sure this is the right mailing list so please tell me !
Seems it is...
I am trying to develop a program that would check into some flash memory information (set early on by a userspace application) to know on which kernel and which partition it has to boot on.
I am trying a standalone application not sure that it is the more appropriate because of compilation problems.
Oops? Why make it so complicated?
Why not simply set and read some environment variable(s)? At least that's what every other project I've seen so far is doing.
Best regards,
Wolfgang Denk

Dear Wolfgang Denk,
Thanks for the answer. Do you mean using fw_printenv fw_setenv ? That is what I am thinking about. But I can't find a fw_env.config that wouldn't warn me about a "bad CRC". The fw_printenv seems to work half way :
root@myboard:~# fw_printenv Warning: Bad CRC, using default environment bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm bootdelay=5 baudrate=115200
It misses a lot of variables.
And the setenv : root@myboard:~# fw_setenv test 1234 Warning: Bad CRC, using default environment root@myboard:~# fw_printenv bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm bootdelay=5 baudrate=115200 test=1234
My config is this one : # MTD device name Device offset Env. size Flash sector size /dev/mtd2 0x0000 0x80000 0x80000
My partitions are those : root@myboard:~# cat /proc/mtd dev: size erasesize name mtd0: 00080000 00040000 "X-Loader" mtd1: 00180000 00040000 "U-Boot" mtd2: 00080000 00040000 "Environment" mtd3: 00300000 00040000 "Kernel" mtd4: 1fa80000 00040000 "File System"
Is my configuration file good ? When I reboot my board it doesn't save my changes. Where can I get the sources of a fw_saveenv program ?
Thanks a lot for your help.
Regards,
Maxime

Dear Maxime Boure,
Please stop sending HTML. This is strongly discouraged on this list.
In message AANLkTik0nK69NfhQow6b5cbvnd7CN_9f2kJsDvbfX_Lx@mail.gmail.com you wrote:
Thanks for the answer. Do you mean using fw_printenv fw_setenv ? That is what I am thinking about.
Yes, that's what I mean.
But I can't find a fw_env.config that wouldn't warn me about a "bad CRC".
That's a problem to be solved, then.
The fw_printenv seems to work half way :
root@myboard:~# fw_printenv Warning: Bad CRC, using default environment bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm bootdelay=5 baudrate=115200
It misses a lot of variables.
So the configuration is incorrect.
My config is this one : # MTD device name Device offset Env. size Flash sector size /dev/mtd2 0x0000 0x80000 0x80000
My partitions are those : root@myboard:~# cat /proc/mtd dev: size erasesize name mtd0: 00080000 00040000 "X-Loader" mtd1: 00180000 00040000 "U-Boot" mtd2: 00080000 00040000 "Environment" mtd3: 00300000 00040000 "Kernel" mtd4: 1fa80000 00040000 "File System"
And what does the environment configuration in U-Boot look like? Which board is this?
Is my configuration file good ? When I reboot my board it doesn't save my changes. Where can I get the sources of a fw_saveenv program ?
Your configuration is obviously NOT good - otherwise there weren't any such errors.
The source is part of the U-Boot code, see the tools/env/ directory.
Best regards,
Wolfgang Denk
participants (2)
-
Maxime Boure
-
Wolfgang Denk