VPortStartFirstTask() Issue

sriku03 wrote on Monday, 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
)
}

rtel wrote on Monday, 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:

Regards.

sriku03 wrote on Tuesday, 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

rtel wrote on Tuesday, October 29, 2013:

Which instruction within the vPortStartFirstTask() function does it fail on and what executes after the failure occurs? (hard fault?)

Regards.

sriku03 wrote on Tuesday, 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

rtel wrote on Tuesday, 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.

sriku03 wrote on Thursday, October 31, 2013: