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] [March 2014 Threads]
The FAQ: http://www.freertos.org/FAQHelp.html
States: "I get stuck on the line that starts for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd );
Likely causes include:
[...snip...]
Calling an API function from within a critical section or when the RTOS scheduler is suspended."
Can this prohibition be clarified to limit calls to API functions which might run the scheduler within taskENTER_CRITICAL() regions? That is, allow API functions that don't run the scheduler?
To provide easy to use contracts between modules, I'd like to use lazy instantiation of communication
mechanisms like this:
~~~~~~
:::c
xQueueHandle getValidAppQueue(void)
{
static xQueueHandle appStateQueueHandle = 0;
taskENTERCRITICAL();
if (!appStateQueueHandle) {
appStateQueueHandle = xQueueCreate(1, sizeof( appStateQueueType));
}
taskEXITCRITICAL();
return appStateQueueHandle;
}
~~~~~~
But the FAQ implies that by calling XQueueCreate within a critical region, I'm violating the FreeRTOS API.
-Thoughts?
-Mike
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.