[U-Boot] In U-Boot-2013-01, __stringify is not working
Wolfgang Denk
wd at denx.de
Thu May 30 15:04:22 CEST 2013
Dear Balaji N,
In message <CAF8Ym8preSb4fjRNUNMhgjGMq_zQUaKGf_cfPBQG+hPotEv-mA at mail.gmail.com> you wrote:
>
> In U-Boot-2013-01 version & P3041 board, __stringify is not working.
> Enabled the DEBUG mode and got the output as:
>
> *** Warning - bad CRC, using default environment
>
> Destroy Hash Table: 3ffa9b90 table = 00000000
> Create Hash Table: N=221
> INSERT: table 3ffa9b90, filled 1/223 rv 3fe2f858 ==> name="bootcmd"
> value="setenv bootargs root=/dev/$bdev rw console=$consoledev,$baudrate $o"
> INSERT: table 3ffa9b90, filled 2/223 rv 3fe2eef8 ==> name="ramboot"
> value="setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $oth"
> INSERT: table 3ffa9b90, filled 3/223 rv 3fe2f2f4 ==> name="nfsboot"
> value="setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ip"
> Bad trap at PC: 3ff7efc8, SR: 21200, vector=d00
...
> For first 3 environment variable, it is working fine. When it reaches the
Is it, really? To me the variable values look pretty much truncated
after exactly 67 characters.
> environment variable
> "bootdelay=" __stringify(CONFIG_BOOTDELAY) "\0"
>
> it gets corrupted.
What makes you think so? If I look at the strings in the compiles
image (using for example "strings -a u-boot.bin"), I see:
...
bootcmd=setenv bootargs root=/dev/$bdev rw console=$consoledev,$baudrate $othbootargs;tftp $loadaddr
$bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr
ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr
$ramdiskfile;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr
nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$
netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp
$fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr
bootdelay=10
baudrate=115200
...
All these values look perfectly fine for me, and __stringify has
worked fine for bootdelay, too.
Your problem must be caused by something else. If I were you I would
fire up the debugger and check why the values of bootcmd, ramboot,
and nfsboot are truncated after exactly 67 characters.
There appears to be a problem ealier in the code.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Every program has at least one bug and can be shortened by at least
one instruction - from which, by induction, one can deduce that every
program can be reduced to one instruction which doesn't work.
More information about the U-Boot
mailing list