MPC56xx __start.c - use far addressing to text section

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

MPC56xx __start.c - use far addressing to text section

850 Views
kadiraktas
Contributor III

Hello I wanna ask a question about __start.c.

I'm using MPC5674F and I have a fatal error that prevents code running. When I connect to processor, I check the Program Counter register. It shows me __start.c source file -->


#if defined(USE_FAR_ADDRESSING_TO_TEXT_SECTION)
lis r6,exit@ha
addi r6,r6,exit@l
mtlr r6
blrl
#else
b exit
endif‌

I wonder how a processor has made such an error? What does it mean? ( When I re-download my code to processor, it works. But sometimes I get an error like that )


Anybody have any idea?

Labels (1)
0 Kudos
5 Replies

695 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I wonder how a processor has made such an error? What does it mean?

Which error do you refer?

I cannot see any issue here from processor side. Is it no jumping to the exit label or?

regards,

Peter

0 Kudos

695 Views
kadiraktas
Contributor III

Thank for reply

I mean, the software stops working at this code block and kick the software to Ivor1_Trap. I don't know what issue is. When I check disassembly page, I see --> ' addi     r6,r6,exit@l ' code line before kicking to ivor_branch_table. So the software doesn't go on.

regards,

0 Kudos

695 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

When I check disassembly page, I see --> ' addi     r6,r6,exit@l ' code line before kicking to ivor_branch_table. So the software doesn't go on.

This should be quite simple.

addi instruction wont make you code jump to IVOR1. It is just simple add instruction which update core register R6.

I guess your issue is blrl branch to link register. Make sure that before executing blrl you have correct branch address in link register. If address in link register points to some reserved area you will get IVOR1.

regards,

Peter

0 Kudos

695 Views
kadiraktas
Contributor III

In a normal operation (download code to processor and everything is ok) : The software passes lines from 225 to 232 and jump to my main. There is no problem.

But once I got this error when I checked disassembly. I didn't download the software to same processor again to check again according to your advices. When I connect to the processer that not running the software, it jumps line 244 (second if block in the following figure) and my application does not run. 

pastedImage_1.png

I don't know what the problem is about. 

I guess your issue is blrl branch to link register. Make sure that before executing blrl you have correct branch address in link register. If address in link register points to some reserved area you will get IVOR1

Isn't this area (second if block) that shouldn't be entering during in a normal opeation?

0 Kudos

695 Views
petervlna
NXP TechSupport
NXP TechSupport

But once I got this error when I checked disassembly. I didn't download the software to same processor again to check again according to your advices. When I connect to the processor that not running the software, it jumps line 244 (second if block in the following figure) and my application does not run. 

But what is the content of your link register? I guess it is @exit.

What is the consequence before it jump to line 244? From where it jumps to line 244?

When you stop at start address, and step in debugger is it processing lines 226 -> 232?

If yes, it jumps to main from 232? If not check your link register.

Are there any interrupts on background?

This is clearly application issue. And if you cannot share any code (output file) with us we can only guess.

Peter

0 Kudos