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 2012 Threads] LPC178x Systick and interruptsPosted by Frank Andersen on March 1, 2012 I am trying to find out why my project ends up in vListInsert:
/* *** NOTE *********************************************************** If you find your application is crashing here then likely causes are: 1) Stack overflow - see http://www.freertos.org/Stacks-and-stack-overflow-checking.html 2) Incorrect interrupt priority assignment, especially on Cortex M3 parts where numerically high priority values denote low actual interrupt priories, which can seem counter intuitive. See configMAX_SYSCALL_INTERRUPT_PRIORITY on http://www.freertos.org/a00110.html 3) Calling an API function from within a critical section or when the scheduler is suspended. 4) Using a queue or semaphore before it has been initialised or before the scheduler has been started (are interrupts firing before vTaskStartScheduler() has been called?). See http://www.freertos.org/FAQHelp.html for more tips. **********************************************************************/
for( pxIterator = ( xListItem * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) { /* There is nothing to do here, we are just iterating to the wanted insertion position. */ }
To me it looks like the Systick interrupts preempts the USB interrupt:
In FreeRTOSConfig I have:
/* Use the system definition, if there is one */ #ifdef __NVIC_PRIO_BITS #define configPRIO_BITS __NVIC_PRIO_BITS #else #define configPRIO_BITS 5 /* 32 priority levels */ #endif
/* The lowest priority. */ #define configKERNEL_INTERRUPT_PRIORITY ( 31 << (8 - configPRIO_BITS) ) /* Priority 5, or 160 as only the top three bits are implemented. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( 5 << (8 - configPRIO_BITS) )
/* Priorities passed to NVIC_SetPriority() do not require shifting as the function does the shifting itself. Note these priorities need to be equal to or lower than configMAX_SYSCALL_INTERRUPT_PRIORITY - therefore the numeric value needs to be equal to or greater than 5 (on the Cortex M3 the lower the numeric value the higher the interrupt priority). */ #define configDMA_INTERRUPT_PRIORITY5 #define configUSB_INTERRUPT_PRIORITY6 #define configTIM1_INTERRUPT_PRIORITY7 #define configTIM3_INTERRUPT_PRIORITY8
#define configLCD_INTERRUPT_PRIORITY4 #define configGPIO_INTERRUPT_PRIORITY10
And in SHPR2 the value is 0xF8F80000, which I belive is the lowest priority?
How is priority between the peripherals interrupts and system interrupts?
I have a pin toggling in the TICK_HOOK and a pin in the USB it handler, when the system crashes the USB interrupt is Active and then the TICK_HOOK is called.
Any Ideas?
Best regards,
Frank Andersen
RE: LPC178x Systick and interruptsPosted by Richard on March 1, 2012 Interrupt priorities look ok *provided* the LCD interrupt does not call any FreeRTOS [interrupt safe] API functions. Only interrupts at priority 5...31 can do that with the settings you have.
What else is you USB ISR doing? Is it only calling API functions that end in "FromISR"? Do you have stack checking on?
Regards.
RE: LPC178x Systick and interruptsPosted by Frank Andersen on March 2, 2012 Well, how come that the solution alwys shows up when you ask a question.
It turned out that the USB call to xQueueSendFromISR, not always was within the interrupt, the call is used from a callback function so it was not that obvious.
Best regards, Frank Andersen
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|