Debugger jumps into misalign interrupt when code size exceeds 0x20000 bytes.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Debugger jumps into misalign interrupt when code size exceeds 0x20000 bytes.

1,006 次查看
Charlie
Contributor III

Processor is the 56f8367 (which has 512k program flash, so I shouldn't be even near the limit) and I am using Codewarrior 8.3.

 

from the xMap file

 

00000000 00000000 000000AE .p_interrupts_ROM

000000AE 000000AE 000000C6 .p_flash_ROM

00000174 00000174 0001FE8D .p_flash_ROM

 

The total of these three is 0x20001

 

The first time the program calls "memset," it jumps into the illegal instruction interrupt

 

if I remove a single i = 0; from the code, the resultant xMap contains

 

00000000 00000000 000000AE .p_interrupts_ROM

000000AE 000000AE 000000C6 .p_flash_ROM

00000174 00000174 0001FE8B .p_flash_ROM

 

The total drops to 0x1FFFF

 

And this it runs without a problem.

 

What gives?  Why does it vomit on the 2^17 address location?  What are potential fixes?

 

Thank you.

标签 (1)
0 项奖励
回复
3 回复数

723 次查看
TICS_Fiona
NXP Employee
NXP Employee

Copy my reply to you in SR as below:

First, please use large data model in your project when code size exceeds 0x20000 bytes.

The second, please add the "alignsp" in the "#pragma interrupt" for ISR, like:

#pragma interrupt alignsp

For subroutines of ISR, please use:

#pragma interrupt alignsp called

Hope this helps!

0 项奖励
回复

723 次查看
Charlie
Contributor III

Hey Fiona,

First, thank you for your help.  Second, I do not believe it is an interrupt problem as no matter where I put the first "memset," I always have the problem there.

I've dug a bit deeper and "touched" the "Runtime 56800e lmm.lib" file and now when I try to compile it, it complains that it "do not have the same memory model as the project."

In the documentation, it mentions something about the e_flags and compiling with the large memory model, but I cannot find any additional information on how to do this.

0 项奖励
回复

723 次查看
Charlie
Contributor III

Actually, scratch that.  I had turned off Large Data Memory Model to see what would happen.  Turning it back on made the "do not have the same memory model" problem go away.

I still think that interrupts are not the problem, unless there is something else I am missing.

0 项奖励
回复