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 2011 Threads] XSemaphoreGiveFromISR takes forever sometimesPosted by cynergizer on November 30, 2011 I am using xSemaphoreGiveFromISR, which normally takes just a few usecs to execute, but everyone once in a while it takes 54 ms to execute. I've tracked this down to prvAddTaskToReadyQueue in vTaskRemoveFromEventList in xQueueGenericSendFromISR. I'm using an LPC2378 running at max speed of 72Mhz. I do allow task preemption, but I do not nest interrupts. My timing measurements are from wiggling a pin and measuring it on scope, triggering via excessive pulse width. Searching through the forum, it looks like someone had a similar problem which Richard thought might be caused by a stack overflow?
RE: XSemaphoreGiveFromISR takes forever sometimesPosted by cynergizer on November 30, 2011 This problem seems to go away when I turn off MAM. Bizarre.
RE: XSemaphoreGiveFromISR takes forever sometimesPosted by MEdwards on December 1, 2011 “ I've tracked this down to prvAddTaskToReadyQueue in vTaskRemoveFromEventList ” prvAddTaskToReadyQueue() calls vListInsertEnd(), which is a deterministic function (it always takes the same time to execute). void vListInsertEnd( xList *pxList, xListItem *pxNewListItem ) { volatile xListItem * pxIndex;
/* Insert a new list item into pxList, but rather than sort the list, makes the new list item the last item to be removed by a call to pvListGetOwnerOfNextEntry. This means it has to be the item pointed to by the pxIndex member. */ pxIndex = pxList->pxIndex;
pxNewListItem->pxNext = pxIndex->pxNext; pxNewListItem->pxPrevious = pxList->pxIndex; pxIndex->pxNext->pxPrevious = ( volatile xListItem * ) pxNewListItem; pxIndex->pxNext = ( volatile xListItem * ) pxNewListItem; pxList->pxIndex = ( volatile xListItem * ) pxNewListItem;
/* Remember which list the item is in. */ pxNewListItem->pvContainer = ( void * ) pxList;
( pxList->uxNumberOfItems )++; } “This problem seems to go away when I turn off MAM. Bizarre.” Not really. The original 2368 and 2378 parts have known bugs in the MAM. Check the errata for your revision to see if the bug is still there. I think the FreeRTOS demo for the 2368 always turns the MAM off for that reason.
RE: XSemaphoreGiveFromISR takes forever sometimesPosted by cynergizer on December 5, 2011 Hi Edwards, Thanks for your response. Yes, I agree there is nothing in vListInsertEnd that explains this delay. I don't see any mention of the MAM in the errata for the 2378 (although I did have trouble using MAM in combination with IDLE mode and usb on the LPC2148). Best Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|