Quality RTOS & Embedded Software

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


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

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

Latest News

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

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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

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