Why PowerPC need 'far' and 'near' but ARM don't?

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

Why PowerPC need 'far' and 'near' but ARM don't?

跳至解决方案
1,174 次查看
liujinhang
Contributor III

We know that PowerPC and ARM are both 32 bits architecture, why PowerPC need 'far' and 'near' but ARM don't?

I used ARM, I never used 'far' and 'near' to tell compiler to distinguish the 24bits address or 32bits address.

 

I am using MPC5744 now. I put some global variables into an obsalute address in RAM.

variable A adress is 0x40000001;

variable B adress is 0x40040001;

when i copy A to B, I found my project become unsteady. but when i add the '-farcalls' in the compiler commands, it become steady.

So i feel it very strange.

Any body can help me find the reason?

标签 (1)
1 解答
932 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

According Power Architecture Build Tools Reference.pdf:

near_abs — objects must be within the range -65,536 bytes to 65,536 bytes

(16 bits on each side)

far_abs — objects must be within the first 32 bits of RAM

 

Your compiler should warn you if objects are out of range. If they are, you may either use far addressing mode or compiler could have option “Tune relocation”, if enabled, linker the linker will generate so called branch islands what’s should solve the issue as well.

pastedImage_1.png

在原帖中查看解决方案

3 回复数
932 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

Unfortunately I don’t know how it works with ARM MCUs, I know document comparing ARM with PowerPC, possibly it could help:

https://static.docs.arm.com/dai0245/b/DAI0245B_migrating_from_ppc_to_arm.pdf

0 项奖励
933 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

According Power Architecture Build Tools Reference.pdf:

near_abs — objects must be within the range -65,536 bytes to 65,536 bytes

(16 bits on each side)

far_abs — objects must be within the first 32 bits of RAM

 

Your compiler should warn you if objects are out of range. If they are, you may either use far addressing mode or compiler could have option “Tune relocation”, if enabled, linker the linker will generate so called branch islands what’s should solve the issue as well.

pastedImage_1.png

932 次查看
liujinhang
Contributor III

Any body help me?

0 项奖励