Using newlib (was: [Efi332] Building newlib/libgloss for MPC555)

David Eicher sailors3
Wed Aug 10 03:05:21 UTC 2005


Hi Jeff,

 

Thanks for the thoughts! You?re correct, I?m running in RAM and there is no
exception table loaded in Flash, so it is all 0xFFFFFFFFs. It looks like it
went to 0x1000 and tried to execute the instruction there, the debugger
printed ?illegal opcode ? 0xFFFFFFFF?. 

 

I decided to try single stepping through printf to see what it does. It
executed the following routines:

 

Printf

Vfprintf

Localeconv         (libc ? locale.o)

Vfprintf              (returned to vfprintf from localeconv)

Strlen

Vfprintf

Sfvwrite

 

In sfvwrite the program lost it?s mind. One instruction before the crash the
debugger displayed the instruction that would be executed next as 

 

BCCTRL r20, r0             0x4E800421

 

When I hit step again, CRASH! The debugger displayed:

 

PC: FFFFFFFF    CR: 5DFF3FF9   MSR: 00003402

LR: 00C0C118   XER: E000FC7F

<FFFFFFFF>: UNKNOWN OPCODE

 

The PC just before this crash was: 0x00C0C114 which contained the opcode
0x4E800421.

 

I looked this instruction up in the UM and it appears to be okay to me, BO
is set to ?always branch?, BI is set to ?LT? (less than ? the condition to
branch on), the LK = 1 and the LR register was modified to 0x00C0C118 which
seems like the right value (CIA + 4).

 

So, what is up with this! I don?t know if my processor is broke or if this
is a illegal form of the instruction, or what. I?m not sure where the code
was headed next but was anxious to find out. It took about 1 ? hours of
single stepping to get to that point.

 

Any thoughts you might have on this would be appreciated.

 

Thanks,

 

Dave

 

 

  _____  

From: efi332-bounces at diy-efi.org [mailto:efi332-bounces at diy-efi.org] On
Behalf Of bowtievette at aol.com
Sent: Tuesday, August 09, 2005 5:44 PM
To: efi332 at diy-efi.org
Subject: Re: Using newlib (was: [Efi332] Building newlib/libgloss for
MPC555)

 

 

 
-----Original Message-----
From: Gunter Magin <gm at ib-magin.de>
To: efi332 at diy-efi.org
Sent: Tue, 9 Aug 2005 15:35:32 +0200
Subject: Re: Using newlib (was: [Efi332] Building newlib/libgloss for
MPC555)

Hi,

 

> It's hard to tell what happened when I run the code because I don't trust

> this debugger. I did set a software breakpoint at mbx-outbyte, it never
got

> there. The debugger says the machine is still running (not in BDM debug

> mode), but nothing is happening. So I click on "halt" and check the PC reg

> and find I'm at 0x1000 with an illegal opcode. The exception vectors go

> 0x100 through 0xE00, I don't find one for 0x1000 so I'm not sure why it
goes

> there.

 

Table 3-21 on the MPC555UM says 0x1000 is "Implementation dependent SW

emulation", that is, an illegal opcode. Chances are the linker has

picked the wrong library. Double check the map file.

You have to be careful with that exception. It may be only the last
exception 

that occurred. Dave, if you have not populated your exception table, or if
the

table is stale with respect to your application in RAM (I presume you are 

running from RAM), then almost any exception will find some illegal opcodes

and trigger the software emulation exception (0x1000). To unravel the
source, 

you must have your table populated so that you can determine when the
various 

exceptions are called. Counters, setting discretes, etc are useful here.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.diy-efi.org/pipermail/efi332/attachments/20050809/6d173f49/attachment.html 



More information about the Efi332 mailing list