I try to implement a GPIO Interrupt function on microblaze.
According to the documentation (Free-RTOS-for-Xilinx-MicroBlaze-on-Spartan-6-FPGA.html) I have to use xPortInstallInterruptHandler. My autocompletion finds the function"xPortInstallInterruptHandler" - fine. The problem is that I get following error after build: undefined reference to `xPortInstallInterruptHandler’.
I’m using Vitis 2023.1 and the FreeRtos-Hello-World-Example.
User 216004noaveevee reported a similar issue:
Xilinx/AMD forum title “Microblaze FreeRTOS Interrupts”
…but no solution there.
(Sorry, I’m not allowed to post links as new user)
I made following progress:
xPortInstallInterruptHandler is available in the code, but deactivated by Xil_Timer. I disabled Xil_Timer and can build the code.
Interrupt is working with following lines:
xPortInstallInterruptHandler(GpioInterruptId, (XInterrruptHandler)gpio_interrupt_handler, &Gpio);
vPortEnableInterrupt(GpioInterruptId);
XGpio_InterruptEnable(&Gpio, 0x2); //Channel 2
XGpio_InterruptGlobalEnable(&Gpio);
With that lines the gpio handler gets executed, after a button pressed. (In my case many times…Maybe I have to implement some debouncing and InperrutpDisable. but that is another story:) )
I don’t know, if it is handled correctly in that way.
Is the sequence of calling that functions ok?
What is the purpose of Xil_Timer in the BSP?
In my example I put the lines in a task before the loop. Should I move the lines before scheduler-start or is it ok to leave the lines in a task?