[ECOS] eCos Startup, where to enable interruots the first time

Stanislav Meduna stano@meduna.org
Mon Mar 28 11:39:00 GMT 2011

On 26.03.2011 21:43, Richard Rauch wrote:

> We thought, in cyg_start we should enable interrupts. But after in
> Cyg_Scheduler::start_cpu HAL_THREAD_LOAD_CONTEXT is called. This function
> disables the interrupt bit in armreg_cpsr again 

AFAIR the HAL_THREAD_INIT_CONTEXT should set the context
so that the interrupts are enabled - at least that's
what hal\arm\arch\current\include\hal_arch.h says
in its comment and what the CPSR_THREAD_INITIAL is
set to. This is also what the comment in
Cyg_Scheduler::start_cpu says.

If you set the breakpoint in the thread's function
and upon arriving there it has interrupts disabled in
the CPSR, something is wrong.

Debugging the context switch itself is a bit problematic -
don't count on the PSR value gdb tells you during the


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

More information about the Ecos-discuss mailing list