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

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

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

Jump to solution
1,031 Views
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?

Labels (1)
1 Solution
789 Views
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

View solution in original post

3 Replies
789 Views
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 Kudos
790 Views
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

789 Views
liujinhang
Contributor III

Any body help me?

0 Kudos