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] [October 2013 Threads] lpc3131 Context switch issuePosted by thompsonian on October 31, 2013 FreeRTOS 7.5.3
NXP lpc3131
Apologies if this is a known problem and I haven't dug in far enough.
I have a board modeled on the ea3131 but running with a slightly different XTAL.
The board normally runs with some non-RTOS code but I want to play with the uIP stack on it and hence am trying to get FreeRTOS running.
If I have a single task created and start the scheduler all seems well. The task runs, I get print out on the serial port, xTickCount increments nicely, LEDs seem to flash at the correct rate.
However, if I create two tasks before starting the scheduler, I get xTickCount = 1 and end up in vApplicationStackOverflowHook. Looking at the stacks, they don't appear corrupted or too large.
There appears to be something wrong in how the interrupts handle the context switching.
Has anyone seen anything like this before?
I'm running in Preemptive mode.
lpc3131 Context switch issuePosted by richardbarry on November 1, 2013 In the scenario where you are able to successfully have one task running - what priority is the task? If it is the idle priority (0) then does the idle task run too? If you are creating the task above the idle priority then try running it at the idle priority - you will then effectively have two tasks running that should time slice. Does that work?
Regards.
lpc3131 Context switch issuePosted by thompsonian on November 18, 2013 So this ended up being a bad processor that eventually failed, forcing me onto another development board that works fine!
So I'm now running multiple tasks but I do have a question about system and supervisor mode.
Before turning on the scheduler, I'm in supervisor mode and calls to the NXP supplied gpio routines work and cause an LED to flash.
Tasks run in system mode and I have a task which does the same gpio call as in supervisor mode but the LED does not flash. I don't get any unprivileged traps, all of the tasks run.
System mode is a privileged mode so why doesn't the call work?
lpc3131 Context switch issuePosted by richardbarry on November 18, 2013 Other than the stack used, there is little difference between System mode and Supervisor mode, so I doubt that is the cause of the change in behaviour. Can you step through the LED toggle function to see what happens?
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|