FreeRTOS Support Archive

The FreeRTOS support forum can be used for active support both from Amazon Web Services
and the community. In return for using our software for
free, we request you play fair and do your bit to help others! 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.

System stack switch sequencing (PIC32)

Could you clarify the sequence of operations for ISRs to use the system stack when the ISR uses the Queue FromISR functions that need that trailing "if (hiPriTaskWaiting)" check?

Until we get our hands on the OpenRTOS USB Device stack, we're using the Microchip device stack, which is a pretty big ISR -- especially as it hooks down into our code which drops the incoming char (or buffer) on a queue in the interrupt context. So we're motivated to switch stacks when it is running to avoid having to have that much room on 10+ other tasks.

It seems that the first step is to "wrap" the ISR from an assembly file like this:

RE: System stack switch sequencing (PIC32)

If you follow the instructions in the "interrupt service routines" section of this page:

http://www.freertos.org/port_PIC32_MIPS_MK4.html

and copy the example in the demo that that page documents, then FreeRTOS will automatically handle switching to an interrupt/system stack for you. It is also explained in the FreeRTOS PIC32 tutorial book.