Quality RTOS & Embedded Software

NOTE:This is a read only archive of threads posted to the FreeRTOS support forum. Use these archive pages to search previous posts. New forum support threads can be started at the FreeRTOS forums.

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 for an account and 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. Use these archive pages to search previous posts. New forum support threads can be started at the FreeRTOS forums.

Interrupts being disabled

Hi,
I’m working on the FreeRTOS port on the zynq platform. I am doing some SPI transfers in the ISR handler and once every few minutes, i’m getting errors during the SPI transfers (RX Buffer overrun and Tx Buffer underrun). I believe these errors are a result of interrupts being disabled.
We have several tasks, but if I disable a particular task(happens to be the highest priority task on our system), I do not see the SPI transfer errors. So, I’m thinking that something this task is doing is causing the interrupts being disabled that is affecting the SPI transfers.
Question is what APIs should I be looking for that could potentially be disabling interrupts. I searched for taskENTERCRITICALSECTION but we are not using it. Can you point me to other calls that could be disabling interrupts. I see that the xSemaphoreTake() and xSemaphoreGive() would also disable interrupts but I suppose it is done so very briefly that it should not affect the SPI transfers.
Thanks for your help.

Interrupts being disabled

Hi Sean,
I’m afraid that you don’t provide enough information to give a satisfying answer.
At what speed do you run SPI?
Is it a byte-by-byte transfer or do you use DMA?
Is your Zynq the SPI Master?
( making a CPU a SPI slave is always very problematic )
Who is delivering the data for the SPI, is that a regular task? Does that task get enough attention from the CPU when your high-priority task is running?
Do the TX buffers get filled on time?
Do the RX buffers get flushed on time?
Are RX buffers available when a burst of data comes in?
When interrupts are disabled in the FreeRTOS kernel, it happens indeed very briefly.
The Zynq is a very fast CPU, I suppose you have it running at 666 Mhz? Or less?
Are you sending a lot of SPI data? If you are sending KB’s of data, I would definitely consider using DMA channels.
Regards.

ifdef ENDAT22

endif

Interrupts being disabled

Wait a minute…I don’t particularly know the Zynq CPU… but if it is running at multiple hundred MHz speeds, I expect it has multiple priority levels within the CPU, and, at least on the port I am familiar with, CPU priority levels and RTOS priority levels are different animals, so we need to be extremely careful about that.
On the Microchip dsPIC30F architecture, all of the tasks run at CPU priority zero, the freeRTOS kernel runs at CPU priority 1, and there are additional, higher CPU priorities available for interrupts such as the SPI handler.
I also suggest you AUDIT the source code for the meanings of the critical section and disable interrupts primitives…you will need to know exactly what those do in your architecture. On the pic, both of those simply raise the current CPU priority level to that of the RTOS priority.
Hope this helps!