Interrupts on FreeRTOS and Xilinx Standalone BSP

I have interrupts configured and running on stanalone xilinx BSP. When I start FreeRTOS tasks using vTaskStartScheduler , my stanlone BSP interrupts stops working. For example, I have GPIO interrupt enabled and working using xilinx’s stanalone BSP API but they no longer work as soon as FreeRTOS starts the HelloWorld task.

Its been awhile since I’ve used the Xilinx parts, but it used to be that their provided port totally reinitialized the interrupt controller when they setup the tick interrupt, so any interrupts configured before calling vTaskStartScheduler got disabled, and had to be enable AFTER FreeRTOS started running.

Thank you for the reply.
I did that however call to start scheduler never returns so there is no way to intialize and setup interrupts after FreeRTOS scheduler is started.

You set them up at the beginning of some task.

That, or (if the problem is still there) fix the problem with their setup code.

You can also use this hook to setup interrupts - FreeRTOS-Kernel/timers.c at main · FreeRTOS/FreeRTOS-Kernel · GitHub

The timer code is too involved. Is there a simple example to setup I2C interrupt handler for ZCU102 development card?

Which timer code you are talking about?

Assuming that the problem is because of interrupt controller getting re-initialized during tick interrupt setup as described by @richard-damon, (and so can be resolved by delaying the interrupt setup to a task), you should be able to resolve it by moving the interrupt setup to vApplicationDaemonTaskStartupHook. If you are using FreeRTOS software timers, then you need to do the following -

  1. Set configUSE_DAEMON_TASK_STARTUP_HOOK to 1 in your FreeRTOSConfig.h
  2. Define a function void vApplicationDaemonTaskStartupHook( void ) and put the interrupt setup code in that function.

I did as you mentioned. Set configUSE_DAEMON_TASK_STARTUP_HOOK to 1 in FreeRTOSConfig.h and created void vApplicationDaemonTaskStartupHook( void ). te function never gets called

Sorry. There are 2 FreeRTOSConfig.h files. I set the configUSE_DAEMON_TASK_STARTUP_HOOK in correct one and vApplicationDaemonTaskStartupHook gets called, however the timer does not run, i.e - vTaskDelay() never returns so there must be something wrong with timer.

Is your tick interrupt firing? You can check that by examining the value of the global variable xTickCount.

Where is xTickCount incremented? Also, where does FreeRTOS installs its timer interrupt? Thank you for your help.

Here. This function is called form the port layer.

Should also be in the port.c file. Which port.c file are you using?

I found the solution. I was overwriting FreeRTOS interrupt handler.