Altera_Forum
Honored Contributor
21 years agoTarget reboots during driver debug
I am debugging a modified lan91C111 driver for a custom board using the uCos telnet example (modified). Quartus4.1, NiosII CPU32 'tiny' IDE 1.0.
The driver has been modified to use a 16bit native bus. This question is more about the debugger and debugging with uCos. My target reboots shortly after my first rx interrupt, either under the debugger, or just running, flashed or sof'ed. I have turned on all the debug flags in the lwip code and sprinkled in printfs so I can somewhat trace the execution. I also have a partial hw probe of the 'C111. What happens is the debug console (jtag uart) stops printing, the driver code does a few more things ('C111 accesses and debug printfs that never reach the console) and then I get a reboot (no external reset). I now have a different image burned into flash that gets loaded and prints to a different serial port, which makes the reboot more obvious. The debugger just thinks that the original thread in the original image is still running. Suspending the thread will give me some info such as sp & pc, but I think most of the info is bogus since a totally new image is running. Synchronisation between image and src is lost isn't it? I believe the reboot is a sw problem in the driver (wild pointer, memory leak). My board does run the other uCos examples. The 'C111 is just a slave with a dedicated interface, so even if it is misconfigured, it should not be able to cause a reboot. Without a functioning console or complete hw trace it is hard to get a good picture of what really happens to cause this reboot. I can set breakpoints, but it appears the pauses introduced by these alter the sequence of execution enough that the code executes longer before rebooting. So what are all the tricks, tips (and features I don't know about) to get more visibility into what is happening? Anything in the quartus patch or IDE 1.01 for me here?