The EPI MAJIC can be used for jtag debugging of the kernel.


Steps that I did.


1) Load the EPI software into /opt/edtm/... .

2) Configure file epimdi.cfg.  I put it into /opt/edtm/bin/epimdi.cfg.  Set
   the IP address, etc.  There are documented example files to start with.

3) Set up a BOOTP server for the device. Some DHCP servers can also do this,
   but the EPI MAJIC uses BOOTP.

4) Connect the JTAG cable to the Brecis board (both powered off).  If there
   are two jtag switches on the board, both go in one direction or the other.

5) Connect serial cable to EPI MAJIC at 9600 and it will show output when it
   boots, and when it gets the IP via the BOOTP protocol.  (i.e. things are
   working.)

   NOTE: you might have to do a firmware upgrade.  Follow instructions in
   the manual.

6) Compile the linux kernel with uClinux/linux/Makefile changed:
    # If using EPI MAJIC jtag debugger, add two lines. -- Needs redo/linuxall
    CPPFLAGS += -g
    LINKFLAGS += -g

7) Start the mdi-server.  There is a script START.mdi-server in this directory.

8) Make sure that mips-gdb connects correctly.
   NOTE: there is a uClinux/linux/.gdbinit file that does a few commands.
   They set up for talking to the EPI device.  It appears the connecting
   via mips-gdb does a reset of the processor.  Thus, there is a "c"ontinue
   to allow pmon to start running.

9) Load via tftp the image.bin per normal.

10) If you don't like mips-gdb, there is a X GUI program called "ddd"
   (Data Display Debugger) that works pretty well.  A few extra windows
   sometimes to close, etc.  Sometimes it claims it can't find a source
   file and opens a window, yet it displays the source file.  Oh well.

   One can "Interrupt" and see where the processor is.  Double clicking
   on variables will display variables in the "Display" window (see tool
   bar next to the "search" text entry box.  Same with seeing functions, etc.

   A "cont" (to continue) works, etc.

   It can be started via the script "DDD" in this directory.  Once again,
   it resets the mips processor when starting it.  It also uses .gdbinit
   in the linux directory.

11) Anyone with more knowledge of gdb or ddd that can educate me with tricks,
    I'd be happy to learn!  I tend to put in kprintf statements.  Thanks!



Things that don't work (usually):
a) "FINISH" the subroutine, stop when return is executed.
b) "continue" followed by "continue".  Things get out of order and confused.
