Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


Problem enabling FPGA interrupts with FreeRTOS and Zynq 7000

Posted by wonger on June 25, 2015

I'm running FreeRTOS on a Zynq 7000 (dual core ARM Cortex-A9, but only using 1 core for FreeRTOS). I enabled FPGA2 interrupt (IntID 63) with the following:

~~~~~~ XScuGicConnect( &xInterruptController, XPSFPGA2INTID, (XilExceptionHandler) FPGA2IntHandler, NULL); XScuGicSetPriorityTriggerType( &xInterruptController, XPSFPGA2INTID, configMAXAPICALLINTERRUPTPRIORITY << portPRIORITYSHIFT, 3 ); XScuGicEnable(&xInterruptController, XPSFPGA2INT_ID); ~~~~~~

The FreeRTOS tick timer interrupt handler is triggering, but not this FPGA2 interrupt handler. I can see the interrupt input line toggling on spistatus0 register. This code on a bare-metal application triggers the FPGA2 interrupt handler, but not in FreeRTOS. Anyone know what I'm missing?

Thanks for your help.

Problem enabling FPGA interrupts with FreeRTOS and Zynq 7000

Posted by rtel on June 25, 2015

I can't see anything obviously wrong. Did you use the code in vConfigureTickInterrupt() as a reference?

I've never tried using that particular interrupt - is there anything different about it compared to say the UART or Ethernet interrupts? [both of which I have used]

Problem enabling FPGA interrupts with FreeRTOS and Zynq 7000

Posted by wonger on June 25, 2015

I found out the problem. I put the FPGA2 interrupt enable code above in prvSetupHardware(). I adapted the demo code from the blinky demo, so I'll put everything in context of that. When main_blinky() runs, it calls vTaskStartScheduler() which eventually gets to vConfigureTickInterrupt().

vConfigureTickInterrupt() calls XScuGic_LookupConfig() and _CfgInitialize() again (they were already called in prvSetupHardware()). This clears out the FPGA2 interrupt enable bit and renders it disabled.

To get it to work, I took out the calls to XScuGic_LookupConfig() and _CfgInitialize() and removed the static reference to xInterruptController in vConfigureTickInterrupt(). I used the global xInterruptController defined in main.c instead, the one initialized by prvSetupHardware().

Is there anything wrong with what I did to get it to work? Why in the demo code does vConfigureTickInterrupt() use a static reference to the interrupt controller rather than the global one define in main.c? Will anything come back to bite me in removing the static reference and using the global one?

Problem enabling FPGA interrupts with FreeRTOS and Zynq 7000

Posted by wonger on June 25, 2015

It also occurred to me that if I put the FPGA2 interrupt enable code in prvQueueSendTask() or prvQueueRecieveTask() (the tasks that drive the blinky demo), I would not have run into this problem. And perhaps that is the more proper place to put this code? Not in those tasks per se, but in a related task that would use FPGA2 interrupt.

Problem enabling FPGA interrupts with FreeRTOS and Zynq 7000

Posted by richard_damon on June 26, 2015

Note that the vConfigureTickInterrupt() is demo code (and thus part of the application) and NOT 'FreeRTOS Kernal code' that shouldn't normally be changed. I have changed that code to use a common instance so the ScuGic isn't reinitialized at this point (and thus lose all the interrupt previously enabled).

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists