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

System tick is not triggerred

Posted by Bobi on October 28, 2011
Hi,

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 */
#ifdef __NVIC_PRIO_BITS
#define configPRIO_BITS __NVIC_PRIO_BITS
#else
#define configPRIO_BITS 5 /* 32 priority levels */
#endif

/* 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
Hi,

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.

Regards.

RE: System tick is not triggerred

Posted by Bobi on October 31, 2011
Hi,

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 ]    [ 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