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] [September 2012 Threads]
I am setting up FreeRTOS+IO for a LPC1765 MCU. I was working from the LPC1769_FreeRTOS_Plus_Featured_Demo package, where the FreeRTOS_IO.h has version 1.0.0.
The problem I'm running into is that the UART IRQ handler is only implemented for UART3. Is there a more complete FreeRTOS+IO package that I should use? Or should I just implement the IRQ handlers for the UARTs that I need?
Thanks,
Josh
Please just create the other UART from the existing UART3. The idea is to keep board support packages that are specific to hardware, and that particular hardware has access to UART3 only.
I have discovered a very small patch to the kernel is required in that version. vTaskPriorityInherit() in FreeRTOS/Source/tasks.c needs a minor modification as follows:
void vTaskPriorityInherit( xTaskHandle * const pxMutexHolder )
{
tskTCB * const pxTCB = ( tskTCB * ) pxMutexHolder;
/* If the mutex was given back by an interrupt while the queue was
locked then the mutex holder might now be NULL. */
if( pxMutexHolder != NULL ) //<<<{
if( pxTCB->uxPriority < pxCurrentTCB->uxPriority )
{
/* Adjust the mutex holder state to account for its new priority. */
listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), configMAX_PRIORITIES - ( portTickType ) pxCurrentTCB->uxPriority );
/* If the task being modified is in the ready state it will need to
be moved in to a new list. */
if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ pxTCB->uxPriority ] ), &( pxTCB->xGenericListItem ) ) != pdFALSE )
{
vListRemove( &( pxTCB->xGenericListItem ) );
/* Inherit the priority before being moved into the new list. */
pxTCB->uxPriority = pxCurrentTCB->uxPriority;
prvAddTaskToReadyQueue( pxTCB );
}
else
{
/* Just inherit the priority. */
pxTCB->uxPriority = pxCurrentTCB->uxPriority;
}
traceTASK_PRIORITY_INHERIT( pxTCB, pxCurrentTCB->uxPriority );
}
}
}
Apologies for this, it is a recent find and not documented yet. I need to put an errata up until the code is changed. (the change is required because a mutex is used where really a binary semaphore (without priority inheritance) should have been used instead.
There are some improvements and enhancements to the user model in the pipeline for the IO code that will introduce some short-cuts to remove the need for the ioctl calls when using the zero copy mode. Watch this space!
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.