FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [March 2007 Threads] Context Switching Problem??Posted by Nobody/Anonymous on March 22, 2007 Hi....
Just wondering if anyone has any insight into my problem....
Ive tested FreeRTOS working on a samsung s344b0x arm7 processor and got it working.... my problem now is that i start the scheduler and the first thread executes, and i think that there is a problem when it switches context , i tried increasing the stack sizes by a lot but the problem still happens, what i'm wondering is how to check that a context switch is happening properly, i.e. all the correct bits are getting pushed and popped..... ive been checking (pxCurrentTCB->pxTopOfStack - pxCurrentTCB->pxStack) and it does come up with some pretty big numbers ??
so through my debugging ive came up with :
first it breaks on the first thread, then it breaks on vPreemtiveTick, then i try to step through the ISR but it pokes out???
Any ideas would be greatly appreciated.
Thanks
Will
RE: Context Switching Problem??Posted by Nobody/Anonymous on March 25, 2007 Try starting with the scheduler in cooperative (set configUSE_PREEMPTION to 0) mode and with two very simple tasks -
int i = 0, j = 0;
void v1( void *pvParameters ) { for(;;) { i++; taskYIELD(); } }
void v2( void *pvParameters ) { for(;;) { j++; taskYIELD(); } }
then you should be able to step through the context switch without the tick getting in the way.
Once you are sure this is working then you can set the registers in both tasks to known values to check that the known values are saved and restored as expected.
once that is working, then you can re-introduce the tick.
These steps are a good way of finding the source of the problem.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|