Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

VPortStartFirstTask() Issue

Posted 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() Issue

Posted 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() Issue

Posted 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() Issue

Posted 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() Issue

Posted 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() Issue

Posted 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() Issue

Posted by sriku03 on October 31, 2013


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS