public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Bug in saveenv handling?
@ 2019-04-09 19:05 U.Mutlu
  2019-04-09 19:39 ` Frank Wunderlich
  0 siblings, 1 reply; 9+ messages in thread
From: U.Mutlu @ 2019-04-09 19:05 UTC (permalink / raw)
  To: u-boot

I just made this unpleasant observation while playing with u-boot:

On the u-boot CLI I changed an envvar and saved the env:
   setenv bootdelay 5 ; saveenv

Then I issued, just for fun, the command "scsi scan", but it crashed
and rebooted the device. But this time on the display only the tuxx logo
and the very first u-boot line is displayed, nothing else happens.

It seems u-boot has overwritten parts of itself on the storage medium (uSD
with FAT boot partition).

I had this experience some more times in the past; after writing u-boot anew
to the uSD it continued working again.
Btw, I once even had the case where saveenv overwrote boot.cmd (but nothing 
else) with garbage (IIRC it was filled full with the char @ ).

I mention this just because it seems that there's maybe a bug in u-boot's
saveenv handling (maybe data was not completely flushed, file handle
was not closed, or maybe the fat write routine is buggy?...).



=> setenv bootdelay 5 ; saveenv
Saving Environment to FAT... OK
=> printenv bootdelay
bootdelay=5

=> scsi scan
scanning bus for devices...
data abort
pc : [<7ef94f8e>]          lr : [<7ef911a1>]
reloc pc : [<4a01af8e>]    lr : [<4a0171a1>]
sp : 7af51bf8  ip : 0000001c     fp : 000000c0
r10: 00000000  r9 : 7af59ed8     r8 : 00000000
r7 : 7af51e78  r6 : 7efd3f54     r5 : 7efdb9b8  r4 : 7efdb9b8
r3 : 00000000  r2 : 00000000     r1 : ea000016  r0 : 7efdb9b8
Flags: nZcv  IRQs off  FIQs off  Mode SVC_32
Code: e92dbd10 f8d045f0 b0858080 1000f8d8 (f8d14604)
Resetting CPU ...

resetting ...

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-04-10 18:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-09 19:05 [U-Boot] Bug in saveenv handling? U.Mutlu
2019-04-09 19:39 ` Frank Wunderlich
2019-04-09 20:53   ` U.Mutlu
2019-04-09 21:01     ` U.Mutlu
2019-04-09 21:21       ` U.Mutlu
2019-04-10  8:00         ` Frank Wunderlich
2019-04-10 18:32           ` U.Mutlu
2019-04-09 21:09     ` Tom Rini
2019-04-09 23:10       ` U.Mutlu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox