Quality RTOS & Embedded Software

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


System tick is not triggerred

Posted by Bobi on October 28, 2011

I am new to FreeRTOS so sorry if that is a stupid question but I really want to figure this out...

I have an IAR program originally written for Cortex M3 using Stellaris. I got it from the source code with the FreeRTOS book - A practical guide. As I don't have the device I want to debug the program with the Simulator. I changed the progect options and everything compiles.

The BIG problem is that the xPortSysTickHandler located in startup_ewarm.c is never called... I think it should be called with every system tick. I have no idea why this happens...
The FreeRTOSConfig.h looks ok - it includes:

/* Use the system definition, if there is one */
#define configPRIO_BITS __NVIC_PRIO_BITS
#define configPRIO_BITS 5 /* 32 priority levels */

/* The lowest priority. */
#define configKERNEL_INTERRUPT_PRIORITY ( 31 << (8 - configPRIO_BITS) )
/* Priority 5, or 160 as only the top three bits are implemented. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( 5 << (8 - configPRIO_BITS) )

I suppose that there is some issue with the demo... running with the IAR simulator but I have no idea what should I change. Any advice will be much helpful :)

Thanks very much!

RE: System tick is not triggerred

Posted by woops_ on October 28, 2011
Look up 'interrupt simulation' in the debuug ewarm_debuggingguide.enu.pdf. You must use the menus in cspy to setup that up. Else it is just an instruction simulator.

RE: System tick is not triggerred

Posted by Bobi on October 28, 2011

Thanks! This tutorial surely explains a lot.
Do you know which are the Interrupts that the FreeRTOS needs and what are their right configuration elements?

I think that I'll need to add the SysTick and the PendSV interrupts but I'm not sure what should be the First activation and Repeat interval parameters?

RE: System tick is not triggerred

Posted by Bobi on October 28, 2011
But aren't these interrupts from the core itself.... or should I configure them explicitly?

RE: System tick is not triggerred

Posted by Richard on October 28, 2011
On a Cortex-M, FreeRTOS needs SVC, SysTick and PendSV. I have no idea how you configure the IAR simulator to simulate these interrupts though as I have never done it. I think IAR support will be able to tell you quickly if it can be done.


RE: System tick is not triggerred

Posted by Bobi on October 31, 2011

I finally got it and I think that it's a good thing to share it with you so that if anyone else happen to have the same problem it would be easier to find a solution.

If you want to run the FreeRTOS examples with the IAR Simulator you have to first choose the Simulator as your Debugger Driver in the Project options and secondly - you need to set up the Simulator Interrupts you want to have.
You go to Simulator > Interrupts Setup. As you already know - The FreeRTOS needs SVC, SysTick and PendSV interrupts. However you need to set up the SysTick only and it will consiquently trigger the other two interrupts.
You need to add the SysTick interrupt. You have to set the required parameters. My example works fine with the following settings:

• First activation - 5000000 - Specify the value of the cycle counter after which the specified type of interrupt will be generated.
• Repeat Interval - 100000 - Specify the periodicity of the interrupt in cycles.
• Hold time - 100000 - Specify how long, in cycles, the interrupt remains pending until removed if it has not been processed. If you select Infinite, the corresponding pending bit will be set until the interrupt is acknowledged or removed.
• Variance - 0 - Selects a timing variation range, as a percentage of the repeat interval, in which the interrupt might occur for a period. For example, if the repeat interval is 100 and the variance 5%, the interrupt might occur anywhere between T=95 and T=105, to simulate a variation in the timing.
• Probability - 100 - Selects the probability, in percent, that the interrupt will actually occur within the specified period.

Regards :)

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

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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

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

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

Cadence Tensilica Cortes

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