Invalid_BP when changing to internal RAM

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

Invalid_BP when changing to internal RAM

1,882 Views
JamesPev
Contributor I
I've been developing an application on the HCS12NE64 eval board. It was running fine using the external memory on that board (the default PRM does not use the 0x2000-0x3FFF internal memory, only 0x400 to 0x1FFF which is mapped to external ram). My application hardware does not have any external ram, so I changed the PRM file to map to internal memory. It compiles/links fine, but when I run the debugger it halts part way through the startup code (specifically in the zero initialization phase) with a "INVALID_BP".

I'm not sure what is happening here. Comparing the .map's from the two different builds shows the only differences being the change in RAM address.

Any ideas?

Thanks!

James
Labels (1)
0 Kudos
Reply
3 Replies

633 Views
JamesPev
Contributor I
I have discovered that the issue only occurs when the stack is moved to the internal RAM. If I leave the stack in the external ram but move everything else it still operates correctly.

I'm pretty confused as to why this is happening. Any ideas would be greaty appreciated.

James
0 Kudos
Reply

633 Views
CompilerGuru
NXP Employee
NXP Employee
Where do you set the INITRM register?
It has to be set before the call to Init, otherwise Init wont return as its return address is on the stack.

Daniel
0 Kudos
Reply

633 Views
JamesPev
Contributor I
The way the initialization files were setup one of the entry point initialization functions was getting bypassed and causing the issue. I believe it was the INITRM register that was the main problem.

James
0 Kudos
Reply