[U-Boot-Users] u-boot in debug mode

Wolfgang Denk wd at denx.de
Tue Aug 12 14:55:25 CEST 2003

Dear Eli,

in message <75DF04AC5ED4D511A9810090273CB4163F5E2E at rokonet-e.rokonet.co.il> you wrote:
> My problem is that the system doesn't stop at breakpoints.

Then it's probably not coming along this way :-)

> I suspect that the 0x1fe0000 is wrong for me.  If I break the program with


> Adding - #define DEBUG to TQM860L.h, gives me errors on flash.c

First, you shouldn't add #define DEBUG to the board config file.  The
"correct"   way  to  enable  debug  to  _all_  code  is  by  changing
"config.mk" as follows:


-#LDSCRIPT := board/$(BOARDDIR)/u-boot.lds.debug
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
+LDSCRIPT := board/$(BOARDDIR)/u-boot.lds.debug
+#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds

Second, you are right, there is a problem in the flash driver. Please
apply this patch:

Index: board/tqm8xx/flash.c
RCS file: /cvsroot/u-boot/board/tqm8xx/flash.c,v
retrieving revision 1.8
diff -u -r1.8 flash.c
--- board/tqm8xx/flash.c	16 Jul 2003 21:36:59 -0000	1.8
+++ board/tqm8xx/flash.c	12 Aug 2003 12:38:30 -0000
@@ -116,14 +116,15 @@
 	/* ENV protection ON by default */
-	debug ("Protect %senvironment: %08lx ... %08lx\n",
-		"primary   ",
+	debug ("Protect primary   environment: %08lx ... %08lx\n",
+		(ulong)CFG_ENV_ADDR,
+		(ulong)CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1);
 # else
-		"",
-# endif
+	debug ("Protect environment: %08lx ... %08lx\n",
 		(ulong)CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1);
+# endif

> 1.  So, how can I get the correct relocation address?

Add a  "#define  DEBUG"  to  "lib_ppc/board.c"  (_before_  the  first
#include!), recompile, install, run.

> 2.  Trying to stop at _start (in start.S) before relocation, also doest not
> work.

_start is the reset entry point. The BDI already stops there when you
type "reset". Once you type "go" it the code will  never  again  pass
this address.

Best regards,

Wolfgang Denk

Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
The IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.

More information about the U-Boot mailing list