Exception vector name: Address Error

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

Exception vector name: Address Error

跳至解决方案
1,333 次查看
matthewthomson
Contributor I

I am working on modifying an existing project (rewrite/redesign) for an MCF52211 and I started with stripping out a bunch of the code from the project so I can focus on a few sections at a time.  All of the startup code, project configuration, linker file are all unchanged and when attempting to run the new code I get an "Exception vector name: Address Error" during part of the start up.

 

The error occurs in the function that is run from the reset vector after initializing memory and doing some hardware initialization.

 

    lea           _SDA_BASE, a5

 

_SDA_BASE is externed at the top of the file

extern unsigned long far _SDA_BASE;

 

And is defined in the *.lcf file

 

.data : AT(___ROM_AT)

  ___DATA_RAM = .;

...

  ___DATA_END = .;
  __SDA_BASE = .;
  . = ALIGN (0x4);
} >> userram

 

and userram is defined as

userram     (RWX) : ORIGIN = 0x20000400, LENGTH = 0x00003C00

 

_SDA_BASE shows in the xmap file as

#>20002088          __SDA_BASE (linker command file)

 

Originally the .data section of the new stripped down code was much smaller than the old version so _SDA_BASE was at 20000A48 but after looking for a reason I decided to try adding data to the section to push it to the same value as the old code just to see if that changed anything but it still doesn't work.  Currently the project settings, *.lcf file and the location of _SDA_BASE are all the same between the two programs but the new one gets that error on the line specified.  The "a5" register isn't even used in the startup code so I could just remove it but I'd like to figure out why the same line works in one situation and not in the other.  Anyone have any ideas?

标签 (1)
0 项奖励
回复
1 解答
886 次查看
matthewthomson
Contributor I

Thanks for the tips.  I added the Coldfire exception handler and was able to break when it was hit and the exception frame actually showed that it was an Access Error not the Address Error that Codewarrior was reporting.  So you were correct that it was not in fact the line that I thought it was.

Turns out it was a section in the linker file that extended past the defined area that I missed when I was checking for that type of thing.

在原帖中查看解决方案

0 项奖励
回复
1 回复
887 次查看
matthewthomson
Contributor I

Thanks for the tips.  I added the Coldfire exception handler and was able to break when it was hit and the exception frame actually showed that it was an Access Error not the Address Error that Codewarrior was reporting.  So you were correct that it was not in fact the line that I thought it was.

Turns out it was a section in the linker file that extended past the defined area that I missed when I was checking for that type of thing.

0 项奖励
回复