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] [November 2013 Threads]
Hello,
I am running an evaluation of FreeRTOS to run a custom HW embedding Cortex-M3 core.
As my HW is not available, I used LM3S811_GCC demo as it is close to what I am targeting.
I run the demo inside Eclipse, and qemu-system-arm to avoid buying other HW and was successful in building, linking and starting the demo.
However I am getting wrong behavior when calling prvPortStartFirstTask()
when executing "svc 0" instruction, it is jumping onto vPortSVCHandler as expected.
However, at that point
lr = 0xFFFFFFF9
whereas before that instruction, I had
lr = 0x0000079F
Note that I get LR being at that value upon breakpoint onto vPortSVCHandler, as for some reason the debugger seems to be puzzled by "svc 0" call.
As such, when executing :
"bx lr" in the vPortSVCHandler, I am getting the UsageFault exception
I would like to know if I am doing anything wrong, I did not make any specific changes compared to initial demo.
From ARM instruction set, I don't see why LR is changing.
Although I am out of usual FreeRTOS bounds with my QEMU emulation, I would appreciate any help regarding this issue. Could that come from emulation itself ?
Thanks,
Ludovic
As a general (ish) rule we are extremely shy of attempting to support anything that is running on an emulator. Experience shows that most issues reported are in the emulator, and it proves to be a huge time sink with no benefit.
However, in this case, take a look at the ARMv7M architecture manuals, and you will see that you in fact do expect LR to change when entering an exception. What you are seeing in the EXC_RETURN value, which tells the hardware how to behave when returning from the exception. The real LR value is safely on the stack, ready to be popped off on exception exit.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.