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] VPortStartFirstTask() IssuePosted by sriku03 on October 28, 2013 Hello,
Every one
In my project application, am executing FreeRtos from External ddr3 memory(arm cortex-M3).
Code executed Upto VportstartFirstTask(), after this function code is not running.
below is the VportstartFirsttask which we used in our application.
Can anyone know what could be the reason??
void vPortStartFirstTask(void)
{
/* Use the NVIC offset register to locate the stack. /
__asm volatile(ldr r0, =0xE000ED08
ldr r0, [r0]
ldr r0, [r0]
/ Set the msp back to the start of the stack. /
msr msp, r0
/ Call SVC to start the first task. */
cpsie i
svc 0
nop
)
}
VPortStartFirstTask() IssuePosted by richardbarry on October 28, 2013 Do you have the FreeRTOS SVC handler installed?
See the red text "special note for ARM Cortex-M users" in the first FAQ item on this page:
http://www.freertos.org/FAQHelp.html
Regards.
VPortStartFirstTask() IssuePosted by sriku03 on October 29, 2013 Hi Richard,
I have SVC handler installed. but its getting stuck inside the void vPortStartFirstTask(void) function as i mentioned.
If i run the same project using some other linker file it works fine. which runs from Onchip memory it works fine.
When i am running from external memory i am facing an issue.
regards,
Srikanth
VPortStartFirstTask() IssuePosted by richardbarry on October 29, 2013 Which instruction within the vPortStartFirstTask() function does it fail on and what executes after the failure occurs? (hard fault?)
Regards.
VPortStartFirstTask() IssuePosted by sriku03 on October 29, 2013 Hi Richard,
we cant see where its going once code is stuck. What i feel is svc 0 line is causing the issue. i am not sure why. I think this is problem with interrupt vector table.
I have 2 projects as,
Main project (which is kind of boot loader, it does not have FreeRTOS) is running from the on-chip eNVM, which loads the binary file of second project (which has freeRTOS) into the DDR.
Then jump to the loaded binary image, which has FreeRTOS. When i am running it i am facing this issue.
If i run this project from on-chip eNVM, it works fine.
Could you please let me know what could be the reason.
regards,
Srikanth
VPortStartFirstTask() IssuePosted by richardbarry on October 29, 2013 When you run out of eNVM are you still using the bootloader? There have been lots of threads about using bootloaders, most of which are normally concluded by the user remapping interrupts before jumping to FreeRTOS.
On boot up the Cortex-M will read its interrupt from address 0 (or whatever memory is mapped to address zero on boot up). If you call SVC 0 before the vector table base address register has been updated to point to the vector table from the FreeRTOS image then the SVC 0 instruction will jump to the SVC handler of your bootloader instead of the SVC handler of FreeRTOS.
Regards.
VPortStartFirstTask() IssuePosted by sriku03 on October 31, 2013
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|