EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Re: Cooperative FreeRTOS on SAM7-ex256 - Interrupts

Started by "FreeRTOS.org Info" December 19, 2007
> I'm using the WinARM GCC.

I have never used WinARM, but assume it to be the same as GNUARM and YAGARTO
as far as functionality and usage goes...

Take a look in port.c, at the function prvSetupTimerInterrupt(). This
installs a different handler depending on the pre-emption setting. The tick
ISR is set to either vNonPreemptiveTick() or vPreemptiveTick(). None of the
interrupt setup code changes so this cannot be the source of any problems.
The definitions of both vNonPreemptiveTick() and vPreemptiveTick() are
contained within portISR.c. Here you will notice that the pre-emptive
version uses a naked attribute and handles the ISR entry and exit itself,
while the non-preemptive version uses the IRQ attribute and relies on the
compiler to create the ISR entry and exit code. Some older GCC versions
have problems with the IRQ attribute - could this be causing you the
problem? Both functions clear the interrupt in exactly the same way - so
again the source code has not other differences that could cause you any
interrupt issues.
As a test, set configUSE_PREEMPTION back to 1, then comment out the call to
vTaskSwitchContext() within vPreemptiveTick() (portISR.c). Commenting out
this line will effectively put you back in cooperative mode, but without any
reliance on the IRQ attribute.

Does that make any difference to you?
Regards,
Richard.

+ http://www.FreeRTOS.org
14 official architecture ports, 1000 downloads per week.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.



Ok! I've made the changes. So this might be the problem. The
interrupts are working, but the tasks do not. What should I do next?

--- In A..., "FreeRTOS.org Info"
wrote:
>
> > I'm using the WinARM GCC.
>
> I have never used WinARM, but assume it to be the same as GNUARM
and YAGARTO
> as far as functionality and usage goes...
>
> Take a look in port.c, at the function prvSetupTimerInterrupt().
This
> installs a different handler depending on the pre-emption setting.
The tick
> ISR is set to either vNonPreemptiveTick() or vPreemptiveTick().
None of the
> interrupt setup code changes so this cannot be the source of any
problems.
>
>
> The definitions of both vNonPreemptiveTick() and vPreemptiveTick()
are
> contained within portISR.c. Here you will notice that the pre-
emptive
> version uses a naked attribute and handles the ISR entry and exit
itself,
> while the non-preemptive version uses the IRQ attribute and relies
on the
> compiler to create the ISR entry and exit code. Some older GCC
versions
> have problems with the IRQ attribute - could this be causing you the
> problem? Both functions clear the interrupt in exactly the same
way - so
> again the source code has not other differences that could cause
you any
> interrupt issues.
>
>
> As a test, set configUSE_PREEMPTION back to 1, then comment out the
call to
> vTaskSwitchContext() within vPreemptiveTick() (portISR.c).
Commenting out
> this line will effectively put you back in cooperative mode, but
without any
> reliance on the IRQ attribute.
>
> Does that make any difference to you?
>
>
> Regards,
> Richard.
>
> + http://www.FreeRTOS.org
> 14 official architecture ports, 1000 downloads per week.
>
> + http://www.SafeRTOS.com
> Certified by T as meeting the requirements for safety related
systems.
>




The 2024 Embedded Online Conference