[Bug 2148] New: Blackfin doesn't switch tasks, resets dispatch_necessary before querying it

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Oct 15 17:11:50 UTC 2013


             Bug #: 2148
           Summary: Blackfin doesn't switch tasks, resets
                    dispatch_necessary before querying it
    Classification: Unclassified
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: rtemsdev at ixo.de

Problem xperienced with bf537Stamp BSP on real hardware (a board with
ADSP-BF537 and just SDRAM and flash attached, only PLL, SDRAM, and UART are

The ticker sample starts its three tasks, but all stall forever in
rtems_task_wake_after(x) for any x greater than 1. Only the Idle task runs.

The clockISR and rtems_clock_tick are executed and clock count is incremented.

Debugging via JTAG with breakpoint at _Thread_Delay_ends made me discover that:

 1. _Thread_Dispatch_necessary = true is set by _Scheduler_priority_unblock

 2. Then it is cleared in cpukit/score/cpu/bfin/cpu_asm.S:480 (doDispatch) by
writing 0 to DISPATCH_NEEDED

 3. Finally _Thread_Dispatch, called by _ISR15_Handler, doesn't do any
Context_Switch because per_cpu->dispatch_necessary (the very same byte) is

As a workaround, removing the two lines after doDispatch in cpu_asm.S leads to
a running ticker sample.

  /* r0 = 0: */
  /* B[p0] = r0; */
  raise 15;

I have not tried other tests yet. I suspect some more inconsistencies. This
doesn't appear like it ever worked...?

Also see discussion here:

Another occurence with similar outcome, maybe for the same reason:

Probably in RTEMS since 2008, with background e.g. discussed here:

Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the bugs mailing list