[ECOS] Problem when debugging via gdb over ethernet

Guenter Ebermann guenter.ebermann@gmx.at
Thu Jun 5 09:36:00 GMT 2008


I would propose the following change in eth_drv.c.

Had the problem when debugging with gdb over ethernet and a diag_printf (which
would then be redirected to the gdb-stub sitting in RedBoot ROMRAM) is used
during the ethernet driver is stopped my system crashed (using FEC driver on

I found a config option which already exists and is used in the same way in other
files where the ethernet driver is stopped/reconfigured temporary.
I think it should be also used in this case.

The suspeced code is called from my RAM application indirectly from init_net() in

Sorry my patch is against our local CVS repository. Our company restriced cvs access
to the outside. Anyway, I checked the place the code is on dev-head over WebCVS
in line 539.

--- packages/io/eth/current/src/net/eth_drv.c	6 Feb 2007 14:41:01 -0000
+++ packages/io/eth/current/src/net/eth_drv.c	5 Jun 2008 09:14:40 -0000
@@ -535,16 +535,36 @@ eth_drv_ioctl(struct ifnet *ifp, u_long 
                  * If interface is marked up and it is stopped, then
                  * start it.
             } else {
+                int orig_console =
+                    CYGACC_CALL_IF_SET_CONSOLE_COMM(
+                        CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
+                /*
+                 * Force default serial console during system initialization
+                 * This avoids problems with debug messages occurring while
+                 * the networking subsystem is being setup.
+                 */
+                CYGACC_CALL_IF_SET_CONSOLE_COMM(0);
                  * Reset the interface to pick up changes in any other
                  * flags that affect hardware registers.
+                /*
+                 * Revert to the original console, which might be a network
+                 * connection
+                 */
+                CYGACC_CALL_IF_SET_CONSOLE_COMM(orig_console);
              * Assumption: drivers should initialize hardware in
              * non-promiscuous mode. If promiscuous mode has been 
              * requested, ask the driver to enable it now.

What do you think?

best regards,
Guenter Ebermann
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list