Tuesday, 4 November 2008

Instable JTAG connection

Currently I'm working on a platform without Ethernet or USB client and therefore I depend on JTAG debugging support for this SH4 based board (Renesas SH7760).

Debugging was quite annoying during the first debug sessions: The debugger always lost the connection after a while.

The reason for that is quite evident: The CPU enters the sleep mode in OEMIdle() as long as there are no busy tasks. But if the CPU "sleeps" the JTAG communication gets broken. So, the only thing that I have to assure is that the CPU does not enter sleep mode.

OEMIdle() in OAL\OALLIB\timer.c is the right location for such an adaption:

Search for "sleep" and enclose it with a define like

#if !defined(DISABLE_OEMIDLE_SLEEP)
__asm("Sleep");
#endif

If you like, you can control this define via the sources.cmn file and a CE catalog feature. Just add these lines


!IF "$(DISABLE_OEMIDLE_SLEEP)"=="1"
CDEFINES=$(CDEFINES) -DDISABLE_OEMIDLE_SLEEP=1
!ENDIF

and create a catalog feature which sets the environment variable DISABLE_OEMIDLE_SLEEP. Do not forget to rebuild oallib if you set or clear your new feature.

No comments: