2nd task switch fails.. arm9

olibats wrote on Thursday, August 16, 2007:

hi,

i have an at91sam9, which has no port available yet. so i took the sam7 one and try to modify it to fit the new cpu.
(once done, i could provide the portation to have it included in freertos)

until today i have the tick-timer running and a single task is running well. if i start calling taskYIELD() to get a task switch the first switch is done well. but: if this tasks calls a taskYIELD() then my program exits into the swihandler so some sort of SWI error occured. unforunatly i have no idea about what could be the reason.

could this be a result of a stack problem? or is the swi interrupt failing?

thanks,
christian

olibats wrote on Thursday, August 16, 2007:

Hey there!

i forgot about my testing code, which allowed me to switch 1 time by force :wink:
so the problem is, that NO tast switch is done and the swi_handler (exception) occurrs.

olibats wrote on Thursday, August 16, 2007:

Hey there again!

i have the task switching running using a provisional solution. the problem is, that within the portISR.c the swi isr vPortYieldProcessor() was not called, although SWI commands were executed. instead it went into that handler error.

if the isr including its prototype is moved to my main.c it will work. BUT: in the meantime my tick-counter stopped ticking.
is there any chance it got influenced by the SWI related stuff?

davedoors wrote on Thursday, August 16, 2007:

I’m not sure that I understand what you are saying.

Have you -

i/ Installed the SWI handler in the vector table.
ii/ Installed the tick handler to be vectored to directly - that is without any code executing between the interrupt occurring and portSAVE_CONTEXT code executing.  Some startup files perform some magic first, you definitely don’t want this.

olibats wrote on Friday, August 17, 2007:

Hello,

i/ do you know how to initialize that? yet i did not do anything here.

ii/ the tick handler is installed using __attribute__((naked)) so, afaik there is no code executed upon enter. first order within that isr is portSAVE_CONTEXT().