public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] System failure!!
@ 2008-04-24 15:38 Alperen Coskun
  2008-04-24 16:25 ` Gary Thomas
  2008-04-25 14:24 ` Davies, Greg
  0 siblings, 2 replies; 7+ messages in thread
From: Alperen Coskun @ 2008-04-24 15:38 UTC (permalink / raw)
  To: ecos discuss



Hi all,

I have a problem that I haven't solved so far. I'm using powerpc and virtex-4 platform. My project was working properly
till I added a row that only assigns a value to a variable in one of the "isr" functions. And my code started to fail. I think
it was working by chance so far :( I recognized that not only adding to "isr" function, it happens also in other parts.

There is no compilation error. But when I download xxx.elf file that I generated, my program stops at one of
the functions. (In fact it doesn't stop, it enters a loop in cyg_hal_default_exception_vsr at different places in asm code but
generally in"sync" assembly code. It doesn't break the loop) The function which causes exception isn't always the same.
It changes according to where and what I have added to the code. (the function I added a piece of code and the function that
causes exception are not same. Also, although it doesn't enter the function that I have added a piece of code, it fails. for example,
altough I add a code to isr function and no inetrrupt occurs, it fails.)

I controlled all the code which may not give compilation error but may cause run-time error. (divide by zero).But even if
there is something like that, it may exit from the exception subroutine and turn back. I'm not sure but, it may be from
memory problem. I checked the memory layout but found nothing unlogical. I didn't understand which causes that problem.

Is there anyone who encountered that problem before or could give any idea?

Regards, Alperen!

_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] System failure!!
  2008-04-24 15:38 [ECOS] System failure!! Alperen Coskun
@ 2008-04-24 16:25 ` Gary Thomas
  2008-04-25 16:48   ` Alperen Coskun
  2008-04-25 14:24 ` Davies, Greg
  1 sibling, 1 reply; 7+ messages in thread
From: Gary Thomas @ 2008-04-24 16:25 UTC (permalink / raw)
  To: Alperen Coskun; +Cc: ecos discuss

Alperen Coskun wrote:
> 
> Hi all,
> 
> I have a problem that I haven't solved so far. I'm using powerpc and virtex-4 platform. My project was working properly
> till I added a row that only assigns a value to a variable in one of the "isr" functions. And my code started to fail. I think
> it was working by chance so far :( I recognized that not only adding to "isr" function, it happens also in other parts.
> 
> There is no compilation error. But when I download xxx.elf file that I generated, my program stops at one of
> the functions. (In fact it doesn't stop, it enters a loop in cyg_hal_default_exception_vsr at different places in asm code but
> generally in"sync" assembly code. It doesn't break the loop) The function which causes exception isn't always the same.
> It changes according to where and what I have added to the code. (the function I added a piece of code and the function that
> causes exception are not same. Also, although it doesn't enter the function that I have added a piece of code, it fails. for example,
> altough I add a code to isr function and no inetrrupt occurs, it fails.)
> 
> I controlled all the code which may not give compilation error but may cause run-time error. (divide by zero).But even if
> there is something like that, it may exit from the exception subroutine and turn back. I'm not sure but, it may be from
> memory problem. I checked the memory layout but found nothing unlogical. I didn't understand which causes that problem.
> 
> Is there anyone who encountered that problem before or could give any idea?

My guess is that you're getting some sort of exception, probably a DATA ACCESS
error, in the ISR code.  The PowerPC exception handlers sometimes don't manage
to report this very well...  The fact that you see it happen on 'sync' is just
because of how the PowerPC works - most operations are queued/pipelined and
the sync instruction forces pending operations to complete.  Thus as illegal
access may happen many instructions before the sync and you'll only see it
on the sync instruction.

You also might think about sharing some of the real code that you're having
troubles with - general discussions are all well and good, but without details
it's hard to help much.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [ECOS] System failure!!
  2008-04-24 15:38 [ECOS] System failure!! Alperen Coskun
  2008-04-24 16:25 ` Gary Thomas
@ 2008-04-25 14:24 ` Davies, Greg
  2008-04-25 17:06   ` [ECOS] " Dave Lawrence
  1 sibling, 1 reply; 7+ messages in thread
From: Davies, Greg @ 2008-04-25 14:24 UTC (permalink / raw)
  To: ecos discuss

 > -----Original Message-----
> Alperen Coskun
> Sent: Thursday, April 24, 2008 11:30 AM
> 
> There is no compilation error. But when I download xxx.elf 
> file that I generated, my program stops at one of the 
> functions. (In fact it doesn't stop, it enters a loop in 
> cyg_hal_default_exception_vsr at different places in asm code 
> but generally in"sync" assembly code. It doesn't break the 

This reminds me of a problem I had a little while ago. The symptoms
aren't the same but the inconsistency of the symptoms is. The fact that
you say eCos was working by chance sounds similar to my issue too. I
never actually solved it or found out what was wrong, but I made it go
away by doing a thorough cleaning of the entire project, including the
generated eCos source tree. I've found there's configuration things that
can get left over sometimes, and will let you keep compiling, even if
the configuration is no good for building from scratch. It's something
quick to try anyway. 

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [ECOS] System failure!!
  2008-04-24 16:25 ` Gary Thomas
@ 2008-04-25 16:48   ` Alperen Coskun
  0 siblings, 0 replies; 7+ messages in thread
From: Alperen Coskun @ 2008-04-25 16:48 UTC (permalink / raw)
  To: ecos discuss; +Cc: Gary Thomas



Dear G. Thomas and G. Davies;
Thanks for your responses.

> My guess is that you're getting some sort of exception, probably a DATA ACCESS
> error, in the ISR code.

Can I get an exception from a function that I didn't call or do you mean while placing the code to the memory,
an exception could occur? But if the second is true, it mustn't do any operation with the start of the main function...
Also, could you give a brief explanation about DATA ACCESS error? My main problem is, adding a piece of code to an
ordinary function results in an exception during another irrelevant function.

I can give the code but in fact I don't know what to give because my project is very big...


>never actually solved it or found out what was wrong, but I made it go
>away by doing a thorough cleaning of the entire project, including the
>generated eCos source tree. I've found there's configuration things that
>can get left over sometimes, and will let you keep compiling, even if
>the configuration is no good for building from scratch. It's something
>quick to try anyway.

Ok, I'll try it. But solving it like that (if I could solve) does not satisfy me. But anyway, I'll try...

Regards, Alperen


> Date: Thu, 24 Apr 2008 09:37:59 -0600
> From: gary@mlbassoc.com
> To: a_a_coskunoc@hotmail.com
> CC: ecos-discuss@ecos.sourceware.org
> Subject: Re: [ECOS] System failure!!
>
> Alperen Coskun wrote:
>>
>> Hi all,
>>
>> I have a problem that I haven't solved so far. I'm using powerpc and virtex-4 platform. My project was working properly
>> till I added a row that only assigns a value to a variable in one of the "isr" functions. And my code started to fail. I think
>> it was working by chance so far :( I recognized that not only adding to "isr" function, it happens also in other parts.
>>
>> There is no compilation error. But when I download xxx.elf file that I generated, my program stops at one of
>> the functions. (In fact it doesn't stop, it enters a loop in cyg_hal_default_exception_vsr at different places in asm code but
>> generally in"sync" assembly code. It doesn't break the loop) The function which causes exception isn't always the same.
>> It changes according to where and what I have added to the code. (the function I added a piece of code and the function that
>> causes exception are not same. Also, although it doesn't enter the function that I have added a piece of code, it fails. for example,
>> altough I add a code to isr function and no inetrrupt occurs, it fails.)
>>
>> I controlled all the code which may not give compilation error but may cause run-time error. (divide by zero).But even if
>> there is something like that, it may exit from the exception subroutine and turn back. I'm not sure but, it may be from
>> memory problem. I checked the memory layout but found nothing unlogical. I didn't understand which causes that problem.
>>
>> Is there anyone who encountered that problem before or could give any idea?
>
> My guess is that you're getting some sort of exception, probably a DATA ACCESS
> error, in the ISR code. The PowerPC exception handlers sometimes don't manage
> to report this very well... The fact that you see it happen on 'sync' is just
> because of how the PowerPC works - most operations are queued/pipelined and
> the sync instruction forces pending operations to complete. Thus as illegal
> access may happen many instructions before the sync and you'll only see it
> on the sync instruction.
>
> You also might think about sharing some of the real code that you're having
> troubles with - general discussions are all well and good, but without details
> it's hard to help much.
>
> --
> ------------------------------------------------------------
> Gary Thomas | Consulting for the
> MLB Associates | Embedded world
> ------------------------------------------------------------

> -----Original Message-----
> Alperen Coskun
> Sent: Thursday, April 24, 2008 11:30 AM
>
> There is no compilation error. But when I download xxx.elf
> file that I generated, my program stops at one of the
> functions. (In fact it doesn't stop, it enters a loop in
> cyg_hal_default_exception_vsr at different places in asm code
> but generally in"sync" assembly code. It doesn't break the

This reminds me of a problem I had a little while ago. The symptoms
aren't the same but the inconsistency of the symptoms is. The fact that
you say eCos was working by chance sounds similar to my issue too. I
never actually solved it or found out what was wrong, but I made it go
away by doing a thorough cleaning of the entire project, including the
generated eCos source tree. I've found there's configuration things that
can get left over sometimes, and will let you keep compiling, even if
the configuration is no good for building from scratch. It's something
quick to try anyway.


_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS]  Re: System failure!!
  2008-04-25 14:24 ` Davies, Greg
@ 2008-04-25 17:06   ` Dave Lawrence
  2008-04-26  0:19     ` Dave Lawrence
  2008-04-26  0:37     ` [ECOS] " Davies, Greg
  0 siblings, 2 replies; 7+ messages in thread
From: Dave Lawrence @ 2008-04-25 17:06 UTC (permalink / raw)
  To: ecos-discuss; +Cc: ecos discuss

Davies, Greg wrote:
>  > -----Original Message-----
>> Alperen Coskun
>> Sent: Thursday, April 24, 2008 11:30 AM
>>
>> There is no compilation error. But when I download xxx.elf 
>> file that I generated, my program stops at one of the 
>> functions. (In fact it doesn't stop, it enters a loop in 
>> cyg_hal_default_exception_vsr at different places in asm code 
>> but generally in"sync" assembly code. It doesn't break the 
> 
> This reminds me of a problem I had a little while ago. The symptoms
> aren't the same but the inconsistency of the symptoms is. The fact that
> you say eCos was working by chance sounds similar to my issue too. I
> never actually solved it or found out what was wrong, but I made it go
> away by doing a thorough cleaning of the entire project, including the
> generated eCos source tree. I've found there's configuration things that
> can get left over sometimes, and will let you keep compiling, even if
> the configuration is no good for building from scratch. It's something
> quick to try anyway. 
> 
Yes there's definately problems with this.  Using the graphical tool, 
the tree is always regenerated if you use the tool to modify the config, 
but if something else modifies the ecc (eg your version control system 
brings in someone else's changes) then these changes might not get 
incorporated in your build.

I don't know if your using configtool or ecosconfig, but now we use 
both.  configtool to edit the ecc, and ecosconfig --tree at the 
beginning of the build script (disregarding the tree generated by 
configtool).

The other two issues I've seen:
  - Changing global build flags doesn't cause a rebuild of everything, 
as you might expect.  Although I have found you can take advantage of 
this bug to individually switch off optimisation or enable 
instrumentation on certain files.

  - Where include files are added or removed, the built tree must be 
deleted and regenerated.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS] Re: System failure!!
  2008-04-25 17:06   ` [ECOS] " Dave Lawrence
@ 2008-04-26  0:19     ` Dave Lawrence
  2008-04-26  0:37     ` [ECOS] " Davies, Greg
  1 sibling, 0 replies; 7+ messages in thread
From: Dave Lawrence @ 2008-04-26  0:19 UTC (permalink / raw)
  To: Davies, Greg; +Cc: ecos discuss

Davies, Greg wrote:
>  > -----Original Message-----
>> Alperen Coskun
>> Sent: Thursday, April 24, 2008 11:30 AM
>>
>> There is no compilation error. But when I download xxx.elf 
>> file that I generated, my program stops at one of the 
>> functions. (In fact it doesn't stop, it enters a loop in 
>> cyg_hal_default_exception_vsr at different places in asm code 
>> but generally in"sync" assembly code. It doesn't break the 
> 
> This reminds me of a problem I had a little while ago. The symptoms
> aren't the same but the inconsistency of the symptoms is. The fact that
> you say eCos was working by chance sounds similar to my issue too. I
> never actually solved it or found out what was wrong, but I made it go
> away by doing a thorough cleaning of the entire project, including the
> generated eCos source tree. I've found there's configuration things that
> can get left over sometimes, and will let you keep compiling, even if
> the configuration is no good for building from scratch. It's something
> quick to try anyway. 
> 
Yes there's definately problems with this.  Using the graphical tool, 
the tree is always regenerated if you use the tool to modify the config, 
but if something else modifies the ecc (eg your version control system 
brings in someone else's changes) then these changes might not get 
incorporated in your build.

I don't know if your using configtool or ecosconfig, but now we use 
both.  configtool to edit the ecc, and ecosconfig --tree at the 
beginning of the build script (disregarding the tree generated by 
configtool).

The other two issues I've seen:
  - Changing global build flags doesn't cause a rebuild of everything, 
as you might expect.  Although I have found you can take advantage of 
this bug to individually switch off optimisation or enable 
instrumentation on certain files.

  - Where include files are added or removed, the built tree must be 
deleted and regenerated.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS] RE: System failure!!
  2008-04-25 17:06   ` [ECOS] " Dave Lawrence
  2008-04-26  0:19     ` Dave Lawrence
@ 2008-04-26  0:37     ` Davies, Greg
  1 sibling, 0 replies; 7+ messages in thread
From: Davies, Greg @ 2008-04-26  0:37 UTC (permalink / raw)
  To: ecos discuss

> Yes there's definately problems with this.  Using the 
> graphical tool, the tree is always regenerated if you use the 
> tool to modify the config, but if something else modifies the 
> ecc (eg your version control system brings in someone else's 
> changes) then these changes might not get incorporated in your build.

In my case it was a combination of using the graphical tool, using
version control, the not-quite-production quality of the build
functionality in eclipse CDT, my laziness for not perfecting my build
process, and my abnormally high level of absent-mindedness, all coming
together in a perfect sotrm of one frustrating week of wasted time.

How about I make my post usefull in some way. If you're new to eCos, try
rebuilding eCos and your app from scratch right now. If it doesn't
recompile when you build from scratch, then be glad you caught the
problem sooner rather than later.

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-25 17:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-24 15:38 [ECOS] System failure!! Alperen Coskun
2008-04-24 16:25 ` Gary Thomas
2008-04-25 16:48   ` Alperen Coskun
2008-04-25 14:24 ` Davies, Greg
2008-04-25 17:06   ` [ECOS] " Dave Lawrence
2008-04-26  0:19     ` Dave Lawrence
2008-04-26  0:37     ` [ECOS] " Davies, Greg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).