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

Periodic Reset - Interrupt Problem ?

Posted by damien h on July 7, 2008

Hi everybody,

Well, i have a problem with FreeRTOS 5.0.0 running on a ARM9 STR912, compilation GCC Yagarto /Eclipse (GCC Port provided by Richard, thanks to him).

After a long time of running (could be 3-4-6 hours), my processor reset by itself.
I m (fairly) sure it's not a problem of stack overflow because i'm monitoring periodically the free memory available via the "water level" (0xa5 in the stack) and i m always with at least 300 bytes free for each task running (5 in fact).


Inside my application, I m using the timer 0 to tick FreeRTOS (1KHz) and i m using also the RTC interrupt.

In my RTC interrupt event, I m NOT using following function, Is it right ?

portSAVE_CONTEXT, portRESTORE_CONTEXT
(save /restore context is done directly in the assemblary file just before / after branch the interrupt)
taskENABLE_INTERRUPTS, taskDISABLE_INTERRUPTS
taskENTER_CRITICAL, taskEXIT_CRITICAL


Note : Nothing is defined with the keyword __naked__.


Thanks in advance.





My interrupt :

void RTC_IRQHandler(void)
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

/* Not necessary to save context-> done in assemblary file*/

/* disable interrupt */
RTC_PeriodicIntConfig(RTC_Per_DISABLE);
RTC_ClearFlag(RTC_FLAG_Per);

/* "Unblock" the task of analog measurement */
xSemaphoreGiveFromISR( xSemaphoreAnalogMeasurement, &xHigherPriorityTaskWoken );

/*new interrupt*/
RTC_PeriodicIntConfig(PULS_ANALOG_RTC_PERIDOCITY_MEASUREMENT);

/* Not necessary to restore context -> done in assemblary file*/
/* Not necessary to write in VIC, done in assemblary*/

}


RE: Periodic Reset - Interrupt Problem ?

Posted by Richard on July 7, 2008
I suspect the saving and restoring of the context will be done within a single IRQ interrupt entry point, before calling the individual handler. This is how the IAR version works. Hence the handler itself is just a standard C function without the naked attribute.

Regards.

RE: Periodic Reset - Interrupt Problem ?

Posted by damien h on July 8, 2008
Thanks for your reply Richard.

Yes, you are true, the GCC Port is the same construction than the IAR port.


BUT Yesterday i disabled my RTC interrupt (for polling FreeRTOS kernel tick), and my software is able to run without crash during a full day.

I except I have a problem when my RTC Interrupt fire and the RTOS is already in the TIM0 interrupt (this timer is used by RTOS to generate kernel tick). Or the opposite : TIM0 fire when i m in the RTC interrupt.


Any idea is welcome !


Damien



RE: Periodic Reset - Interrupt Problem ?

Posted by Anis Ben Abdallah on July 13, 2008
Hi Damien,

The interrupt management on the STR912 is a little bit tricky. I advice you to have a look at an application note on the stmcu website which is " STR912 interrupt management".

The implementation of the interrupt controller on the STR9 is very particular: it is based on 2 daisy chained ARM VICs and you have interrupts which are mapped to VIC0 and other to VIC1 with VIC0 interrupts having higher priority.

I don't like to enter too much in details ( you can have a look at the AN), but I think what you are seeing is the result of a bad interrupt management.

Regards,
Anis



RE: Periodic Reset - Interrupt Problem ?

Posted by damien h on July 14, 2008
Hi Anis, and others


Thanks for your repplies,

I found the problem : Anis was half right, this is a problem of interrupt but not in my RTC interrupt or Timer interrupt but with SPURIOUS interrupt.
Answer is given in the document: (thanks Anis)
http://www.st.com/stonline/products/literature/an/13715.pdf, page 11.

Because I hadn't assigned a new default vector in the VIC0-1, during a spurious interrupt my software was branching to 0x00000000 means reset vector.

Just by adding following lines: everything seems fixed.

VIC0->DVAR = (u32)Dummy_Handler;
VIC1->DVAR = (u32)Dummy_Handler;

Thanks all.

Damien


[ 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