public inbox for ecos-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi"
@ 2011-02-04 13:17 bugzilla-daemon
  2011-02-04 13:37 ` [Bug 1001143] " bugzilla-daemon
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-02-04 13:17 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

           Summary: Ecos crashes when using "nop" instead of "wfi"
           Product: eCos
           Version: CVS
          Platform: stm32e_eval (ST STM3210E EVAL board)
        OS/Version: Cortex-M
            Status: UNCONFIRMED
          Severity: normal
          Priority: low
         Component: HAL
        AssignedTo: unassigned@bugs.ecos.sourceware.org
        ReportedBy: cyrillkuenzle@gmail.com
                CC: ecos-bugs@ecos.sourceware.org
             Class: Advice Request


Created an attachment (id=1118)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1118)
My timers.c

I'm using the ST STM3210E EVAL board default configuration and running the
timer test (timers.c) from rom.
I changed in the hal_arch.h the line from

#define HAL_IDLE_THREAD_ACTION(__count) __asm__ volatile ( "wfi\n" )

into 

#define HAL_IDLE_THREAD_ACTION(__count) __asm__ volatile ( "nop\n" )

I changed the timer as following:

- I use 2 Timers running with 10ms
- I added a busy wait in the isr of the two timers
- I toggle some pins

The result is that after a short time the test crashes.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
@ 2011-02-04 13:37 ` bugzilla-daemon
  2011-02-04 14:22 ` bugzilla-daemon
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-02-04 13:37 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

John Dallaway <john@dallaway.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEEDINFO
                 CC|                            |john@dallaway.org.uk
     Ever Confirmed|0                           |1

--- Comment #1 from John Dallaway <john@dallaway.org.uk> 2011-02-04 13:37:41 GMT ---
Do you have any further info on this issue which would confirm that there is a
bug in eCos rather than just an problem with your application? If not, I
suggest you ask for advice on the ecos-discuss mailing list.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
  2011-02-04 13:37 ` [Bug 1001143] " bugzilla-daemon
@ 2011-02-04 14:22 ` bugzilla-daemon
  2011-02-04 21:30 ` bugzilla-daemon
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-02-04 14:22 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

--- Comment #2 from cyrillkuenzle@gmail.com 2011-02-04 14:22:40 GMT ---
It ends with following assertions

ASSERT FAIL: <1>intr.cxx[292]void Cyg_Interrupt::post_dsr() DSR list is not
empty but its head is 0
ASSERT FAIL: <1>intr.cxx            [ 292] void Cyg_Interrupt::post_dsr()      
                                                                DSR list is not
empty but its head is 0

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
  2011-02-04 13:37 ` [Bug 1001143] " bugzilla-daemon
  2011-02-04 14:22 ` bugzilla-daemon
@ 2011-02-04 21:30 ` bugzilla-daemon
  2011-02-07  7:29 ` bugzilla-daemon
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-02-04 21:30 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

Andreas Schwarz <aschwarz@unifire.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aschwarz@unifire.ch

--- Comment #3 from Andreas Schwarz <aschwarz@unifire.ch> 2011-02-04 21:30:45 GMT ---
Hi, I was testing eCos together with Cyrill. Basically there is no application
programmed by us. We just used the timer test in the cortex stm32 HAL section.
We configured two timers and added some code to toggle hardware pins
(oscilloscope). To force the error within a couple of seconds we changed the
idle thread from WFI to a NOP instruction.

It should be easy to reproduce the error just by running some timers and set
the idle task to NOP instruction.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
                   ` (2 preceding siblings ...)
  2011-02-04 21:30 ` bugzilla-daemon
@ 2011-02-07  7:29 ` bugzilla-daemon
  2011-02-07  8:09 ` bugzilla-daemon
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-02-07  7:29 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

--- Comment #4 from cyrillkuenzle@gmail.com 2011-02-07 07:29:48 GMT ---
Hi John, what kind of information do you need?

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
                   ` (3 preceding siblings ...)
  2011-02-07  7:29 ` bugzilla-daemon
@ 2011-02-07  8:09 ` bugzilla-daemon
  2011-02-07 12:21 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-02-07  8:09 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

Martin Blaser <martin.blaser@intefo.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin.blaser@intefo.ch

--- Comment #5 from Martin Blaser <martin.blaser@intefo.ch> 2011-02-07 08:09:18 GMT ---
Hi 

I'm working on our own hardware with a STM32F103ZEH6 processor and I see the
same assertion. I don't use the default configuration. 

I'm having another problem, which could depend on your problem. When a thread
switch from application thread to Idle thread is executed and in this time a
IRQ occurs, the stack of the Idle thread overflows. The timing is very
important: If the IRQ comes earlier, the thread switch to idle isn't done yet
and no overflow occurs. If it comes later, the idle thread seems to have more
time to cleanup the idle stack and no overflow occurs.

Regards
Martin

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
                   ` (4 preceding siblings ...)
  2011-02-07  8:09 ` bugzilla-daemon
@ 2011-02-07 12:21 ` bugzilla-daemon
  2011-02-07 14:30 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-02-07 12:21 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

--- Comment #6 from John Dallaway <john@dallaway.org.uk> 2011-02-07 12:21:18 GMT ---
(In reply to comment #4)

> Hi John, what kind of information do you need?

Hi Cyrill, it looks like you are using a modified version of the STM32 timer
test with a slightly modified HAL. There are quite a number of eCos developers
working with this board and this is the first report we have received in this
area.

Realistically, it's unlikely that anyone will be willing to spend the time to
attempt to reproduce this issue due to the modifications you have made. I
suggest that you work backward towards pristine code from the position you are
in at present to try to isolate the change that is triggering the issue. Some
possible lines of enquiry:

* Does the unmodified timer test work when using "nop" instead of "wfi"?
* Does your code work when executed from RAM?
* Are there other eCos configuration changes you have made which may be
relevant?

Place a breakpoint in the assert handling code to allow you to generate a
backtrace. Post your progress to this bug report in case someone within the
community has an idea based on your findings.

BTW, I am not clear what you mean by "added a busy wait in the isr of the two
timers". Typically, you should not wait for anything within an ISR.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
                   ` (5 preceding siblings ...)
  2011-02-07 12:21 ` bugzilla-daemon
@ 2011-02-07 14:30 ` bugzilla-daemon
  2011-03-04 10:34 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-02-07 14:30 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

--- Comment #7 from cyrillkuenzle@gmail.com 2011-02-07 14:29:47 GMT ---
I let now running the unmodified timer test. I just using the "nop" instead of
the "wfi" in the Idle thread Action. The result is, that it either crashes
after the first printf: INFO:<Start Timers test> or that it runs through
correctly. 

BTW I haven't seen the ASSERT FAIL and the program is still running from flash

Regards 
Cyrill

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
                   ` (6 preceding siblings ...)
  2011-02-07 14:30 ` bugzilla-daemon
@ 2011-03-04 10:34 ` bugzilla-daemon
  2011-03-04 10:49 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-03-04 10:34 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

--- Comment #8 from Andreas Schwarz <aschwarz@unifire.ch> 2011-03-04 10:33:43 GMT ---
(In reply to comment #6)

Hi John

We had some problems to explain the error. Basically the device crashes under
heavy load or special circumstances like having to interrupts overlapping or
one with a busy loop in it.

Recently, Stanislav Meduna mentioned a bug in the mailing list regarding the  
HAL_DISABLE_INTERRUPTS macro for Cortex-M3. The result of this macro in
Assembler is that the BASEPRI register is not changed.

We checked our Assembler code and found a lot of this faulty code:

f04f 0320       mov.w   r3, #32
f3ef 8311       mrs     r3, BASEPRI
4619            mov     r1, r3
f381 8811       msr     BASEPRI, r1
613b            str     r3, [r7, #16]

The solution is:

> # define HAL_DISABLE_INTERRUPTS(__old)          \
>     __asm__ volatile (                          \
>         "mrs    %0, basepri             \n"     \
>         "mov    r1,%1                   \n"     \
>         "msr    basepri,r1              \n"     \
>         : "=r" (__old)                          \
>         :  "I" (CYGNUM_HAL_CORTEXM_PRIORITY_MAX)\
>         : "r1"                                  \
>         );

As we fixed this, we were not able to reproduce this behavior any more.

I was looking for a bug report describing this fault. As there is still no bug
report: should I replay on the mailing list (02/16/11) or just add new one
based on our findings?

- Andreas

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
                   ` (7 preceding siblings ...)
  2011-03-04 10:34 ` bugzilla-daemon
@ 2011-03-04 10:49 ` bugzilla-daemon
  2011-03-04 12:51 ` bugzilla-daemon
  2011-03-04 13:06 ` bugzilla-daemon
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-03-04 10:49 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

--- Comment #9 from John Dallaway <john@dallaway.org.uk> 2011-03-04 10:48:58 GMT ---
(In reply to comment #8)

> The solution is:
> 
> > # define HAL_DISABLE_INTERRUPTS(__old)          \
> >     __asm__ volatile (                          \
> >         "mrs    %0, basepri             \n"     \
> >         "mov    r1,%1                   \n"     \
> >         "msr    basepri,r1              \n"     \
> >         : "=r" (__old)                          \
> >         :  "I" (CYGNUM_HAL_CORTEXM_PRIORITY_MAX)\
> >         : "r1"                                  \
> >         );
> 
> As we fixed this, we were not able to reproduce this behavior any more.
> 
> I was looking for a bug report describing this fault. As there is still no bug
> report: should I replay on the mailing list (02/16/11) or just add new one
> based on our findings?

Stano raised bug 1001154 and the HAL_DISABLE_INTERRUPTS() macro is now fixed in
CVS. Are you or Cyrill able to confirm that the current version of the macro
resolves the issue reported here?

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
                   ` (8 preceding siblings ...)
  2011-03-04 10:49 ` bugzilla-daemon
@ 2011-03-04 12:51 ` bugzilla-daemon
  2011-03-04 13:06 ` bugzilla-daemon
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-03-04 12:51 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

--- Comment #10 from Andreas Schwarz <aschwarz@unifire.ch> 2011-03-04 12:51:30 GMT ---
(In reply to comment #9)

> Are you or Cyrill able to confirm that the current version of the macro
> resolves the issue reported here?

Yes, is now tested over a longer period without a crash.

thx
Andreas

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] Ecos crashes when using "nop" instead of "wfi"
  2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
                   ` (9 preceding siblings ...)
  2011-03-04 12:51 ` bugzilla-daemon
@ 2011-03-04 13:06 ` bugzilla-daemon
  10 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-03-04 13:06 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

John Dallaway <john@dallaway.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |DUPLICATE
         AssignedTo|unassigned@bugs.ecos.source |john@dallaway.org.uk
                   |ware.org                    |

--- Comment #11 from John Dallaway <john@dallaway.org.uk> 2011-03-04 13:06:36 GMT ---
Thank you for the confirmation. Marking bug as RESOLVED.

*** This bug has been marked as a duplicate of bug 1001154 ***

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi"
@ 2011-02-04 13:17 bugzilla-daemon
  0 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2011-02-04 13:17 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001143

           Summary: Ecos crashes when using "nop" instead of "wfi"
           Product: eCos
           Version: CVS
          Platform: stm32e_eval (ST STM3210E EVAL board)
        OS/Version: Cortex-M
            Status: UNCONFIRMED
          Severity: normal
          Priority: low
         Component: HAL
        AssignedTo: unassigned@bugs.ecos.sourceware.org
        ReportedBy: cyrillkuenzle@gmail.com
                CC: ecos-bugs@ecos.sourceware.org
             Class: Advice Request


Created an attachment (id=1118)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1118)
My timers.c

I'm using the ST STM3210E EVAL board default configuration and running the
timer test (timers.c) from rom.
I changed in the hal_arch.h the line from

#define HAL_IDLE_THREAD_ACTION(__count) __asm__ volatile ( "wfi\n" )

into 

#define HAL_IDLE_THREAD_ACTION(__count) __asm__ volatile ( "nop\n" )

I changed the timer as following:

- I use 2 Timers running with 10ms
- I added a busy wait in the isr of the two timers
- I toggle some pins

The result is that after a short time the test crashes.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


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

end of thread, other threads:[~2011-03-04 13:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-04 13:17 [Bug 1001143] New: Ecos crashes when using "nop" instead of "wfi" bugzilla-daemon
2011-02-04 13:37 ` [Bug 1001143] " bugzilla-daemon
2011-02-04 14:22 ` bugzilla-daemon
2011-02-04 21:30 ` bugzilla-daemon
2011-02-07  7:29 ` bugzilla-daemon
2011-02-07  8:09 ` bugzilla-daemon
2011-02-07 12:21 ` bugzilla-daemon
2011-02-07 14:30 ` bugzilla-daemon
2011-03-04 10:34 ` bugzilla-daemon
2011-03-04 10:49 ` bugzilla-daemon
2011-03-04 12:51 ` bugzilla-daemon
2011-03-04 13:06 ` bugzilla-daemon
  -- strict thread matches above, loose matches on Subject: below --
2011-02-04 13:17 [Bug 1001143] New: " bugzilla-daemon

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).