[U-Boot-Users] Error reading environment with fw_printenv

llandre r&d2 at dave-tech.it
Wed Jan 5 12:12:40 CET 2005


Hi,

I'm running fw_printenv tools on the target (ARM9 running Linux 2.6.9-rc2).
MTD partitions work fine (tried to read some bytes with dd).
I encounter the following problem.
When the function flash_io (fw_env.c) tries to read the CRC and the flags,
the function read reads just one byte instead of 5 as specified
by len parameter ((line 538)):


                 if (read (fd, &environment, len) != len) {
                         fprintf (stderr,
                                 "CRC read error on %s: %s\n",
                                 DEVNAME (curdev), strerror (errno));
                         return (-1);
                 }

So the function quits even if errno==0.

Is it correct to assume that the read actually reads the specified number 
of bytes?



Regards,

llandre

DAVE Electronics System House - R&D Department
web:   http://www.dave-tech.it
email: r&d2 at dave-tech.it





More information about the U-Boot mailing list