Quality RTOS & Embedded Software

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




Loading

task scheduling stm32-p107

Posted by *anonymous 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


task scheduling stm32-p107

Posted by davedoors 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


task scheduling stm32-p107

Posted by *anonymous 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?


task scheduling stm32-p107

Posted by *anonymous 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?


task scheduling stm32-p107

Posted by *anonymous on January 17, 2012

In case anyone else stumbles upon the same problem, I fixed it by replacing

#ifdef STARTUP_FROM_RESET
  .word reset_handler
#else
  .word reset_wait
#endif /* STARTUP_FROM_RESET */

with

  .word reset_handler


task scheduling stm32-p107

Posted by richardbarry 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.

http://rowley.zendesk.com/entries/50337-application-not-starting-up-from-reset

Regards.


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists