Quality RTOS & Embedded Software

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




Loading

Recent changes that could affect behavior of vPortStartFirstTask

Posted by westmorelandeng on May 3, 2016

Hello,

Have there been any recent changes that could affect behavior of vPortStartFirstTask? Specifically any of the ARM R4F ports?

Thanks, John W.


Recent changes that could affect behavior of vPortStartFirstTask

Posted by rtel on May 3, 2016

Not that I am aware of.


Recent changes that could affect behavior of vPortStartFirstTask

Posted by westmorelandeng on May 5, 2016

Hello Richard,

I am having to do this in my portASM.s:

vPortStartFirstTask: portRESTORECONTEXTFIRSTTASK ; will run in debugger ;; portRESTORECONTEXT ; this won't

And the difference is:

;;;                LDR LR, [LR, #+60]      ;; this will run standalone
                        LDR LR, [SP, #-0x04]          ;; this runs in the debugger

Thanks, John W.


Recent changes that could affect behavior of vPortStartFirstTask

Posted by westmorelandeng on May 5, 2016

Hello FreeRTOSer's,

A slight mod in port.c fixed this; I want to test this for a while before publishing the fix.

Regards, John W.


Recent changes that could affect behavior of vPortStartFirstTask

Posted by westmorelandeng on May 11, 2016

Hello,

For the port I am running under IAR for the TI Hercules processor - I have made the following change in ./portable/ARM_Cortex-R4/port.c:

in StackTypet *pxPortInitialiseStack( StackTypet *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )

In order to get the first task to start properly:

pxTopOfStack = ( StackType_t ) 0x00000000; / R14 */

has been changed to:

pxTopOfStack = ( StackType_t ) pxOriginalTOS - 64; / R14 */

Here is my comment I have in my code: // *** this is a fix for the first task to start - otherwise it // *** is taking the contents of 0 (zero), adding 60 and taking // *** that as the address before subtracting 4 and loading // *** that to the PC; which is wrong. It doesn't hurt to do // *** this fix-up since R14 is the LR for this architecture. // *** --- jcw

Appears to be an innocuous fix to get the first task started.

Regards, John W.


Recent changes that could affect behavior of vPortStartFirstTask

Posted by heinbali01 on May 11, 2016

Hi John,

What release of FreeRTOS are you using?

What version of port.c are you writing about?

Is it this file ?

~~~~ FreeRTOSV9.0.0rc2FreeRTOSSourceportableIARARMCM4Fport.c ~~~~

PS. The easiest way to include literal code is to surround it with two lines that only contains 4 tildas (~~~~)

~~~~ /* Asterix may be used within a code block / pxTopOfStack = ( StackType_t ) 0x00000000; / R14 */ ~~~~

A single word within a phrase can be put between /* backquotes */.

And I guess that the backslash * also works to show special characters.

regards.


Recent changes that could affect behavior of vPortStartFirstTask

Posted by westmorelandeng on May 11, 2016

Hello Hein,

I am using the tip of the FreeRTOS SVN tree.

The port I am using isn't part of the official release. I took what was what you have pointed out (and is the same file I illustrated in my post) and have modified it. But that port.c is pretty much the same.

Regards, John W.


[ 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