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 problemPosted by Ricky on March 27, 2007 I'm developing a test application under ARM9 (STR912F) with 2 tasks controlling the UART. Initialization seems to run smoothly until the first task switch occurs. In the portRESTORE_CONTEXT macro (in ISR_Support.h), the instruction "LDMFDLR, {R0-R14}^" restores all registers for the task, including LR which now contains 0xAAAAAAAA (this value was set in the pxPortInitialiseStack function). However, the next instruction is LDR LR, [LR, #+60] which reads the return address from 0xAAAAAAAA+60 which is a garbage address. The value read is 0x00000000. What am I missing here?
RE: Context switching problemPosted by Nobody/Anonymous on March 27, 2007 This is a bang on symptom of the processor not being in Supervisor mode when the context of the task is restored.
Are you starting in Supervisor mode? Are interrupts occurring that use the UART prior to the scheduler being started? Your answers should be "yes", "no", respectively.
Dave.
RE: Context switching problemPosted by Ricky on March 29, 2007 The processor was starting in User mode. I was using the wrong set of library files. I downloaded the updated ones from ST and was using them instead of the ones from FreeRTOS. I added the line to enter Supervisor mode and it works. Thanks!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|