public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Relocation issue - need help!
@ 2014-10-22 12:39 Wolfgang Denk
  2014-10-22 13:29 ` Dirk Eibach
  0 siblings, 1 reply; 32+ messages in thread
From: Wolfgang Denk @ 2014-10-22 12:39 UTC (permalink / raw)
  To: u-boot

Hi,

I'm trying to track down a "syntax error" issue that gets triggered
when erasing the U-Boot image in NOR flash.  Symptoms look like this:

	=> print update
	update=protect off 0xfc000000 +${filesize};erase 0xfc000000 +${filesize};cp.b 200000 0xfc000000 ${filesize};protect on 0xfc000000 +${filesize}
	=> run update
	Un-Protected 2 sectors

	.. done
	Erased 2 sectors
	syntax error
	Protected 2 sectors
	=> run update
	syntax error

git bisect found commit 199adb6 "common/misc: sparse fixes" as
culprit; breaking this down further showed a single line in
common/cli_hush.c to trigger the problem. This patch fixes it:

---
 common/cli_hush.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/cli_hush.c b/common/cli_hush.c
index 38da5a0..5bbcfe6 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -3127,7 +3127,7 @@ static void mapset(const unsigned char *set, int code)
 	for (s=set; *s; s++) map[*s] = code;
 }
 
-static void update_ifs_map(void)
+void update_ifs_map(void)
 {
 	/* char *ifs and char map[256] are both globals. */
 	ifs = (uchar *)getenv("IFS");
-- 
1.8.3.1

But I still have bad feelings - symptoms indicate that this is
actually a relocation issue, as it only gets triggered when erasing
the U-Boot image in NOR flash, so probably there are still pointers to
data in NOR being used.  This patch here is not suited to fix the
original cause of this issue.  But then, I do not see where there
might be a relocation problem.  To be sure I even verified that "ifs"
and "map[]" are really in RAM all the time.

Has anybody an idea how to further track this down?  Or is the patch
above actually a real fix?  If so, why?

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
Old programmers never die, they just branch to a new address.

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

end of thread, other threads:[~2015-10-21 13:18 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22 12:39 [U-Boot] Relocation issue - need help! Wolfgang Denk
2014-10-22 13:29 ` Dirk Eibach
2014-10-22 16:56   ` Wolfgang Denk
2014-10-22 17:26     ` Fabio Estevam
2014-10-22 17:28     ` Tom Rini
2014-10-22 17:39       ` Wolfgang Denk
2014-10-22 21:27       ` Pavel Machek
2014-10-22 21:46         ` Marek Vasut
2014-10-22 21:57           ` Pavel Machek
2014-10-22 22:06             ` Marek Vasut
2014-10-23  6:01     ` Dirk Eibach
2014-10-23  6:42       ` Joakim Tjernlund
2014-10-23 13:10         ` Wolfgang Denk
2014-10-23 13:42           ` Dirk Eibach
2014-10-24 14:14           ` Bill Pringlemeir
2015-09-30 18:24           ` Andy Fleming
2015-09-30 19:35             ` Marek Vasut
2015-10-01  8:57               ` Joakim Tjernlund
2015-10-06 11:17                 ` Joakim Tjernlund
2015-10-15 15:56                   ` Joakim Tjernlund
2015-10-15 21:58                     ` Tom Rini
2015-10-16  6:55                       ` Joakim Tjernlund
2015-10-16 11:47                         ` Tom Rini
2015-10-16 13:14                           ` Joakim Tjernlund
2015-10-20 21:06                             ` Andy Fleming
2015-10-20 21:21                               ` Tom Rini
2015-10-21  8:44                                 ` Joakim Tjernlund
2015-10-21 13:12                                   ` Tom Rini
2015-10-21 13:18                                     ` Joakim Tjernlund
2015-10-01 14:18             ` Wolfgang Denk
2015-10-02 22:51               ` Andy Fleming
2015-10-03  8:33                 ` Wolfgang Denk

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