Hello,
I have a ZYNQ-7030 Dev-board. CPU0 and CPU1 communicate with OpenAMP. CPU0 is on Petalunix, and CPU1 is on FreeRTOS.
Now GPIO ps pin No. 51 link a switch. When the switch is pressed, I want to sample a data on CPU1, and then the data is sent to CPU0.
So I add a Switch device into device tree:
gpio-keys {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
sw2@51 {
label = "sw2";
interrupt-controller;
#interrupt-cells = <2>;
gpios = <&gpio0 51 0>;
gpio-key,wakeup;
linux,can-disable;
};
};
And code into FreeRTOS:
// Init Button Pin status
XGpioPs_SetDirectionPin(&psGpioInstancePtr, GpioPsPinNum_Btn, 0); //MIO pin direct
XGpioPs_SetIntrTypePin(&psGpioInstancePtr,GpioPsPinNum_Btn, XGPIOPS_IRQ_TYPE_LEVEL_HIGH);
XGpioPs_SetCallbackHandler(&psGpioInstancePtr, &psGpioInstancePtr, ISR_GpioPsBtn);
XGpioPs_IntrEnablePin(&psGpioInstancePtr,GpioPsPinNum_Btn);
void ISR_GpioPsBtn(void *CallBackRef, u32 Bank, u32 Status)
{
XGpioPs *pXGpioPsPtr = (XGpioPs *)CallBackRef;
XGpioPs_IntrDisablePin(pXGpioPsPtr, GpioPsPinNum_Btn);
......
......
XGpioPs_IntrEnablePin(pXGpioPsPtr, GpioPsPinNum_Btn);
}
But, the ISR can't be called. Please help found the issue, Thank!!
Beat regards,
Aersean