This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

66AK2E05: CSL GiC for ARM

Part Number: 66AK2E05


Hi !!

i have been trying to implement a bare metal interrupt over the k2e ARM 0 core without success. i am trying to configure the 120 event ID which is the GPIO in the following code

CSL_GpioHandle  hGpio;

CSL_ArmGicIntrParams_t gRtcIntrParams;
extern CSL_ArmGicDistIntrf distrIntrf;

extern CSL_ArmGicCpuIntrf gCpuIntrf;

volatile int a = 0;

void intIsr()
{
	a = 1;
	while(1);
	return ;
}

int main(void)
{
	int pinNum = 0;
	int dummy=0;
	int bankNum = 0;
	uint16_t		intcnumb=120;
	Uint8			outData;
	Uint32 stat;

	printf("print in start\n");

    gCpuIntrf.gicDist = &distrIntrf;
    gCpuIntrf.cpuIntfBasePtr = (void *)SOC_INTC_MPU_PHYS_CPU_IF_BASE;
    distrIntrf.distBasePtr = (void *)SOC_INTC_MPU_DISTRIBUTOR_BASE;
    gCpuIntrf.initStatus = (Uint32)FALSE;
    gCpuIntrf.gicDist->initStatus = (Uint32)FALSE;
    gCpuIntrf.pDefaultIntrHandlers = NULL;
    gCpuIntrf.pDefaultUserParameter = NULL;

    CSL_armGicInit(&gCpuIntrf);

	gRtcIntrParams.triggerType = CSL_ARM_GIC_TRIG_TYPE_HIGH_LEVEL;
	gRtcIntrParams.priority = 0x20U;

    gRtcIntrParams.pFnIntrHandler = &intIsr;
    gRtcIntrParams.pUserParam = NULL;


    CSL_armGicConfigIntr(&gCpuIntrf, 120U, &gRtcIntrParams);
    CSL_armGicEnableIntr(&gCpuIntrf, 120U);

	a = 0;
	pinNum = 0;
	bankNum = 0;

	hGpio = CSL_GPIO_open (0);
	CSL_GPIO_setPinDirOutput (hGpio, pinNum);
    CSL_GPIO_setRisingEdgeDetect (hGpio, pinNum);
    CSL_GPIO_bankInterruptEnable (hGpio, bankNum);
    CSL_GPIO_clearOutputData (hGpio, pinNum);
    CSL_GPIO_getOutputData (hGpio, pinNum, &outData);
    CSL_GPIO_setOutputData (hGpio, pinNum);
    CSL_GPIO_getOutputData (hGpio, pinNum, &outData);

    if (CSL_GPIO_getInterruptStatus (hGpio, pinNum) == 0)
    {
        // Interrupt has not occured
    	printf("nope\n");
    }
    else
    {
    	CSL_GPIO_clearInterruptStatus (hGpio, pinNum);
    }

    CSL_armGicTriggerSWIntr(&gCpuIntrf, 120U);
	while(a!=1){
		dummy=dummy+1;
	}

	printf("GPIO interrupt occurs\n");

	return 0;
}

i have tried multiple other combinations but the interrupt is never called. any help in what the error might be would be appreciated