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


Loosing interrupts on queue and semaphore

Posted by Nobody/Anonymous on November 2, 2005
i am working at a CAN application which reads from multiple CAN interfaces by interrupt, and releases a semaphore (...i also tried a queue) to notify a task. I am loosing up to 30% of my CAN-interrupts.
When i remove the queue/semaphore functions everything seems to be ok.

Port : ARM7
Hardware LPC2294

Any Idea ???



RE: Loosing interrupts on queue and semaphore

Posted by Nobody/Anonymous on November 2, 2005
How fast is the LPC running? (MHz, waitstates, etc), and what is the baud of the CAN?

Are you able to post your ISR code with and without the queues?

RE: Loosing interrupts on queue and semaphore

Posted by Nobody/Anonymous on November 3, 2005

the LPC is running with 48 MHz, (.. i also tried 60MHz). The behavior is the same at internal an external RAM.

CAN-Baudrate is 500Kbps

The CAN-ID's are sent in 1 ms 25% Bus-Load,
10 ms (3% Busload) and 100ms (0,3 % Busload)
There are no bursts at the Bus (checked with Vector-CANalyzer)

The problems occure at 1 and 10 ms

static portCHAR can_isr(unsigned int can_nr)
//portBASE_TYPE xTaskWoken = pdFALSE;
/* put data it inside CAN-Ringbuffer */
if(LPC_CAN[can_nr]->ctrl.gsr.dw & 0x1) {
can_buffer->recv_ringb[can_nr].entries[can_buffer->recv_ringb[can_nr].w_ptr].can.id.dw =
can_buffer->recv_ringb[can_nr].entries[can_buffer->recv_ringb[can_nr].w_ptr].can.data[0].dw =
can_buffer->recv_ringb[can_nr].entries[can_buffer->recv_ringb[can_nr].w_ptr].can.data[1].dw =
can_buffer->recv_ringb[can_nr].entries[can_buffer->recv_ringb[can_nr].w_ptr].ts =
/* release CAN-message */
LPC_CAN[can_nr]->ctrl.cmr.b[0] = 0x4;
/*Ring buffer movement*/
can_buffer->recv_ringb[can_nr].w_ptr ++;
if(can_buffer->recv_ringb[can_nr].w_ptr >= CAN_RING_SIZE) {
can_buffer->recv_ringb[can_nr].w_ptr = 0;
//xTaskWoken = xSemaphoreGiveFromISR(CanIrqSem, xTaskWoken );
//xTaskWoken = xQueueSendFromISR(CanIrqQ,&can_nr, xTaskWoken);
if(LPC_CAN[can_nr]->ctrl.gsr.dw & 0x2) {
LPC_CAN[can_nr]->ctrl.cmr.b[0] = 0x8;
return pdFALSE;
//return xTaskWoken;

void can0_rx_isr(void)
portBASE_TYPE xTaskWoken = pdFALSE;
xTaskWoken = can_isr(0);
/* acknowledge Interrupt */
// VICVectAddr = 0x0L;
/*return from ISR by switching or recovering */



[ 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