e_lis problem for S32R274 Z7a Core

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

e_lis problem for S32R274 Z7a Core

Jump to solution
2,463 Views
Durant-Harden-Irving
Contributor III

Hello,

I met a very strange problems:

Problem Background:

0. Compiler: GreenHills 7.1.6d for S32R274 (Demo Board) 

1. Below code is in .link file:

__DATA_SIZE = SIZEOF(.data);

2.Below code is in .s file (startup file):

DATACOPY:
e_lis r9, __DATA_SIZE@ha # Load upper SRAM load size (# of bytes) into R9
e_or2i r9, __DATA_SIZE@l # Load lower SRAM load size into R9

3. Below code is in main function, I use LAUTERBACH and I can see the value of Evaluation_DataSize  is 0xBA19 (I open map file ,is the same 0xBA19):
extern char __DATA_SIZE[];
int main(void)
{
Evaluation_DataSize = (UL)__DATA_SIZE;

4. But,  in LAUTERBACH, I can see the list is as below:

e_lis        r9, 0x10000     ;r9,65536

e_or2i     r9, 0xBA19      ;r947641

My Problem:

Why the value is 0x10000?  It should be 0x0. It puzzled me, hope your help.

Thanks in advance!

MF
0 Kudos
Reply
1 Solution
2,445 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

got it, I didn't catch that first time. This is the problem:

e_lis r9, __DATA_SIZE@ha # Load upper SRAM load size (# of bytes) into R9
e_or2i r9, __DATA_SIZE@l # Load lower SRAM load size into R9

Two options to load 32bit value to a register are possible:

lis rn, VALUE@ha

addi rn, rn, VALUE@l

Second option:

lis rn, VALUE@h

ori rn, rn, VALUE@l

To solve this problem, you simply need to change @ha to @h.

lukaszadrapa_0-1618467587436.png

 

Regards,

Lukas

 

View solution in original post

0 Kudos
Reply
6 Replies
2,456 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

what is the opcode of this e_lis instruction?

Regards,

Lukas

 

0 Kudos
Reply
2,449 Views
Durant-Harden-Irving
Contributor III

Hello Lukas,

The 

The opcode of this e_lis instruction is 7120E001. For the correct instruction the opcode is 7120E000.

The detail please look at the attachment.

And where I can find the document describing the instructions of S32R274?

Thanks!

MF
0 Kudos
Reply
2,446 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

got it, I didn't catch that first time. This is the problem:

e_lis r9, __DATA_SIZE@ha # Load upper SRAM load size (# of bytes) into R9
e_or2i r9, __DATA_SIZE@l # Load lower SRAM load size into R9

Two options to load 32bit value to a register are possible:

lis rn, VALUE@ha

addi rn, rn, VALUE@l

Second option:

lis rn, VALUE@h

ori rn, rn, VALUE@l

To solve this problem, you simply need to change @ha to @h.

lukaszadrapa_0-1618467587436.png

 

Regards,

Lukas

 

0 Kudos
Reply
2,443 Views
Durant-Harden-Irving
Contributor III

Thanks very much!

Can you send me a link to download the document of the  S32R274 assemble instruction?

MF
0 Kudos
Reply
2,427 Views
Durant-Harden-Irving
Contributor III

Perfect!

Thanks very much!

MF
0 Kudos
Reply