FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2005 Threads] Loosing interrupts on queue and semaphore Posted by Nobody/Anonymous on November 2, 2005 Hello, 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 ???
Thanx,
Peter
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 Hello,
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 = LPC_CAN[can_nr]->rcv.id.dw; can_buffer->recv_ringb[can_nr].entries[can_buffer->recv_ringb[can_nr].w_ptr].can.data[0].dw = LPC_CAN[can_nr]->rcv.data[0].dw; can_buffer->recv_ringb[can_nr].entries[can_buffer->recv_ringb[can_nr].w_ptr].can.data[1].dw = LPC_CAN[can_nr]->rcv.data[1].dw; can_buffer->recv_ringb[can_nr].entries[can_buffer->recv_ringb[can_nr].w_ptr].ts = T0_TC; /* 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; } can_rx_cnt[can_nr]++; //xTaskWoken = xSemaphoreGiveFromISR(CanIrqSem, xTaskWoken ); //xTaskWoken = xQueueSendFromISR(CanIrqQ,&can_nr, xTaskWoken); } if(LPC_CAN[can_nr]->ctrl.gsr.dw & 0x2) { can_buffer->recv_ringb[can_nr].ovrcnt++; LPC_CAN[can_nr]->ctrl.cmr.b[0] = 0x8; } return pdFALSE; //return xTaskWoken; }
void can0_rx_isr(void) { portENTER_SWITCHING_ISR(); portBASE_TYPE xTaskWoken = pdFALSE; xTaskWoken = can_isr(0); /* acknowledge Interrupt */ // VICVectAddr = 0x0L; VICVectAddr = 0xFFFFFFFFL; /*return from ISR by switching or recovering */ portEXIT_SWITCHING_ISR(xTaskWoken); }
Thankx,
Peter
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|