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


Crash when 3 tasks have different priorities

Posted by Gary Austin on January 22, 2013
I am new to FreeRTOS and have been learning using the debug demo project included in Dave Lyneham's rtos.zip which was referenced in the x86 write up (http://www.freertos.org/portternee.html).

In main() I created 3 tasks, Each task does a forever loop incrementing a counter variable and then SLEEP_MS(1000). This code works if the 3 tasks have the same priority. But when I change each task's priority (for example task 1 has priority 1, task 2 has priority 0, and task 3 has priority 2) then the application crashes when vTaskStartScheduler is called.

freertosconfig.h has #define configUSE_PREEMPTION0
The controller board is Tern's B engine with 512 MB SDRAM.
Paradigm C++ V7.00.0054, Tern Edition is the development tool.
The memory model is large.

I would prefer to use preemption but it crashes even when the priorities are identical. Is there something I have to do in addition to the freertosconfig.h #define change?


RE: Crash when 3 tasks have different priorities

Posted by Richard on January 22, 2013
Hmm. That is very old code, not an official zip file (provided by Dave), and probably uses a very old version of FreeRTOS. I'm afraid there is not much help I can provide in this case.

If you are looking to learn and experiment with FreeRTOS in a convenient environment then you could try using the MSVC project with the Win32 simulator demos, or the Keil simulator demo.



RE: Crash when 3 tasks have different priorities

Posted by Gary Austin on January 27, 2013
Thanks Richard.

I have switched to the demo project WizNET_DEMO_TERN_186 for the Tern B Engine 186. I have still encountered task / priority issues with this demo (I am using the Paradigm C/C++ IDE version 7.00 for Tern).

Since I did not have all of the hardware used in this project I commented out the serial and http task creates. I also modified 186.cfg (changed the amount of RAM from 128 to 512, the rdonly map from 0x0800 to 0x7ffff to 0x2c000 to 0x7ffff and the CODE_START from 0x0800 to 0x2c000) and freertosconfig.h (config_USE_IDLE_HOOK from 1 to 0 configCPU_CLOCK_HZ from 80000000 to 40000000).

After downloading the application I set breakpoints inside the various forever loops that are in the created tasks. When I executed the code none of the breakpoints were hit. I did this because an earlier debug session with a breakpoint in the prvCheckTask function in main.c showed that no other task was running so I thought I could confirm this by breakpoints in the forever loops.

What could be causing the lack of task execution other than prvCheckTask (I even changed its priority from tskIDLE_PRIORITY + 4 to tskIDLE_PRIORITY + 2)?

Thanjs for your help.

Best 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