Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Using MPLAB SIM (http://www.chiefdelphi.com/forums/showthread.php?t=45760)

koenig3456 23-03-2006 09:05

Using MPLAB SIM
 
I tried using the MPLAB SIM debugger to debug a program that uses WPILib. I get a Stack over flow error before the main() function is reached. Is there any way to use the MPLAB SIM debugger to debug a program that uses WPILib?

Greg Ross 23-03-2006 10:27

Re: Using MPLAB SIM
 
Quote:

Originally Posted by koenig3456
I tried using the MPLAB SIM debugger to debug a program that uses WPILib. I get a Stack over flow error before the main() function is reached. Is there any way to use the MPLAB SIM debugger to debug a program that uses WPILib?

I don't know about WPILib, but the stack overflow error is the same that I get when I accidentally run a program compiled without the _SIMULATOR symbol defined. Set it on the MPLAB C18 tab of your project's "Build Options" dialog.

b0b0b0b 11-05-2006 13:57

Re: Using MPLAB SIM
 
Thanks, this solved my problem.

sfs 23-01-2008 22:33

Re: Using MPLAB SIM
 
Quote:

Originally Posted by b0b0b0b (Post 500395)
Thanks, this solved my problem.

I am getting the exact same error, even when the _SIMULATOR macro is defined in the MPLAB C18 tab. Is anyone able to use MPLAB SIM with the most recent WPILib (WPILib2k6.lib) on the FRC? I get this error message when trying:

CORE-E0001: Stack overflow error occurred from instruction at 0x0030b2

robofan 10-02-2008 16:40

Re: Using MPLAB SIM
 
I solved stack overflow issue by adding the following code to ifi_frc.h:

#ifdef _SIMULATOR
#define RESET_VECTOR 0x000
#define HIGH_INT_VECTOR 0x008
#define LOW_INT_VECTOR 0x018
#else
#define RESET_VECTOR 0x800
#define HIGH_INT_VECTOR 0x808
#define LOW_INT_VECTOR 0x818
#endif

Also, you need to remove or comment out the following lines in ifi_frc.h:

//#define RESET_VECTOR 0x800
//#define HIGH_INT_VECTOR 0x808
//#define LOW_INT_VECTOR 0x818

sfs 11-02-2008 14:39

Re: Using MPLAB SIM
 
Quote:

Originally Posted by robofan (Post 695991)
I solved stack overflow issue by adding the following code to ifi_frc.h:

#ifdef _SIMULATOR
#define RESET_VECTOR 0x000
#define HIGH_INT_VECTOR 0x008
#define LOW_INT_VECTOR 0x018
#else
#define RESET_VECTOR 0x800
#define HIGH_INT_VECTOR 0x808
#define LOW_INT_VECTOR 0x818
#endif

Also, you need to remove or comment out the following lines in ifi_frc.h:

//#define RESET_VECTOR 0x800
//#define HIGH_INT_VECTOR 0x808
//#define LOW_INT_VECTOR 0x818

That might work if you are using Kevin Watson's ifi_frc base code, but what about those using WPILib where no source code is available?


All times are GMT -5. The time now is 03:20.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi