ILLEGAL_BP error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ILLEGAL_BP error

2,511 Views
Splinter_Cat
Contributor I
   I have read several posts on this error but none of them have helped me.  I am trying to get an IIC bus working, but I get this error when running my master code in the debugger.  I have stepped through my code and the error occurs at a function called INIT_SP_FROM_STARTUP_DESC();. 

Here is what the command window displays:
Frequency change to ~0hz.
STARTED
Frequency change to ~3942400hz.
RUNNING
ILLEGAL_BP

And here is the segment of code where I get the error:
#pragma NO_EXIT
__EXTERN_C void _Startup(void) {
/* set the reset vector to _Startup in the linker parameter file (*.prm):
   'VECTOR 0 _Startup'

   purpose:    1)  initialize the stack
               2)  initialize run-time, ...
                   initialize the RAM, copy down init data, etc (Init)
               3)  call main;
   called from: _PRESTART-code generated by the Linker
*/
 INIT_SP_FROM_STARTUP_DESC();

Can anybody help me understand what is going on here?  Thanks.

Labels (1)
0 Kudos
2 Replies

423 Views
mdelac01
Contributor I
I ran into a similar issue, using HCS08GT8.
The problem was the watchdog reset.  I was not resetting the dog.  By default the HC08 have the watchdog reset enabled.  Either disable it all toghther, or make sure you reset it regularly in your code.
 
Good luck
 
0 Kudos

423 Views
CompilerGuru
NXP Employee
NXP Employee
INIT_SP_FROM_STARTUP_DESC is not a function, it's a macro. It expands to some inline assembly instruction loading the initial stack pointer.
It's not mentioned in your text, so I wonder if it is clear that _Startup is not an ordinary function, it is the entry point of the code usually pointed by the reset vector any maybe other vectors too (COP,...).

So I'm also not clear what exactly you mean with:

>I have stepped through my code and the error occurs at a function called

The point is, _Startup is executed before your code, so if you reach it after your  code did execute, something bad did happen, maybe a COP reset? Maybe something else, but you should not get to _Startup after stepping through your code.

Daniel
PS: In Processor Expert setups, some PE generated initialization code gets executed before _Startup, but user code still happens afterwards (in usual setups).

0 Kudos