Quality RTOS & Embedded Software

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


task scheduling stm32-p107

Posted by mike on January 10, 2012
Hi all,

I am having some problems getting the task scheduling to work, I create a simple task to enable some LED's and then loop forever, this is added to the task list and the scheduler is started. Stepping through the vTaskStartScheduler function, everything seems to be fine, then getting to the vPortStartFirstTask function, I cannot step through and the first task never seems to run. Has anyone else encountered this problem? Or have any idea's what might cause this?

Thanks for any help

RE: task scheduling stm32-p107

Posted by Dave on January 10, 2012
Have you installed the interrupt service routines needed by FreeRTOS? The scheduler is started with an SVC call, and you need systick and pendsv too. If you project is using cmsis naming then you can do this by adding the following lines to FreeRTOSConfig.h

#define xPortPendSVHandler PendSV_Handler
#define xPortSysTickHandler SysTick_Handler
#define vPortSVCHandler SVC_Handler

RE: task scheduling stm32-p107

Posted by mike on January 10, 2012
Thanks for the quick reply.

I am using an existing demo (stm32f107, for a new board), I think I have installed the interrupt service routines, those 3 functions are all in the port.c file. Is there a way to check if they have been installed? When porting to a new board, does the NVIC code need to be updated?

RE: task scheduling stm32-p107

Posted by mike on January 14, 2012
Debugging the code, the first task is not run because the NMI interrupt occurs, I'm not sure if it is a true NMI exception, as seems to just use the first interrupt handler it see's in the vector table. Having trouble figuring out why this occurs though, if anyone has any ideas?

RE: task scheduling stm32-p107

Posted by mike on January 17, 2012
In case anyone else stumbles upon the same problem, I fixed it by replacing

.word reset_handler
.word reset_wait


.word reset_handler

RE: task scheduling stm32-p107

Posted by Richard on January 17, 2012
You shouldn't change the code - it is like that for a reason. You are meant to have STARTUP_FROM_RESET defined in your project options for your release build, but not your debug build.



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

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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner