nobody wrote on Wednesday, September 27, 2006:
My problem is that FreeRTOS works fine for a while, and stops working after 10seconds to 10 minutes after mcu reset, depending on semaphore blocking settings. This is my first bigger app on this rtos. I try to run only one task yet which is blocking and waiting for a semaphore from isr. I’m using WinARM, SAM7S256 port made of SAM7X port from lwIP demo. My ISR/semaphore setup is very similar to this in SAM7_EMAC(_ISR).c and main parts look like this:
//The ISR (compiled in ARM mode)
void RS485_USART0_IRQ_handler( void )
xTaskWokenByPost=xSemaphoreGiveFromISR( xSemaphore_USART0_new_data, xTaskWokenByPost );
AT91C_BASE_US0->US_CR = AT91C_US_RSTSTA;
AT91C_BASE_AIC->AIC_EOICR = 0;
portEXIT_SWITCHING_ISR( xTaskWokenByPost );
//and the task, thumb mode:
void vRS485_task( void * pvParameters )
if(xSemaphoreTake( xSemaphore_USART0_new_data , portMAX_DELAY ))
//some code (lcd write)
ISR is executing every about 200-300ms and execution of the task and ISR surely will not take so long time.
I tried both preemptive and non-preemptive tick, different blocking times in semaphore wait. I have also tried to suspend the task, resume it from isr, simple indicate resume on lcd, and suspend if again (without semaphore). Effects were similar: sometimes it stopped after 10 seconds, sometimes after longer time, like 10 minutes. It’s simple, it really should work… Does anyone know how to fix it? I have no idea even where to start.