I'm using the 2401a on the ezdsp board from spectrum. I'm programming in c.
When the main function calls a subroutine the subroutine runs and then returns to the reset vector at 00h.
The following indicates that this is a problem with the _c_init0 subroutine: http://www-k.ext.ti.com/SRVS/CGI-BIN/WEBCGI.EXE/,/?St=65,E=0000000000012830560,K=9057,Sxi=19,Case=obj(8480)
I have the reset vector as _c_init, and it runs a few lines in dissasembly before calling the main which appears to be what the rts.src says its supposed to do when built with rts2xx.lib. My questions are is there any other problem that could cause this and also how does this routine allow for initializing other variables, constants and functions.
Thanks for any help anyone can provide.
-Doug
Doug,
It sounds like the watchdog is timing-out and causing a reset. Have you disabled the watchdog immediately after entering main()? Here's an example of how to do it:
/* Watchdog timer (WD) registers */#define WDCNTR (volatile unsigned int *)0x7023 /* WD counter reg */#define WDKEY (volatile unsigned int *)0x7025 /* WD reset key reg */#define WDCR (volatile unsigned int *)0x7029 /* WD timer control reg */
/* Disable the watchdog */ *WDCR = 0x00E8; /* disable the dog */
Jeff