Part Number: AM2612
Other Parts Discussed in Thread: SYSCONFIG
Hello,
I am working with the following environment:
Device: AM261x LaunchPad
SDK: motor_control_sdk_am261x_10_02_00_07
IDE: CCS 12.8.1
We aim to assign the interrupt of GPIO124 to System Event 62 of ICSS0-PRU1 on a custom board.
Currently, as shown below, the R5F application acts as an intermediate and notifies ICSS0-PRU1 of System Event 62.
If we want to notify ICSS0-PRU1 directly from GPIO124 without using the R5F application as an intermediary, what changes would be required?
GPIO124 is defined in SysConfig as follows:
PIN Direction: Input
Trigger Type: Falling Edge
Enable Interrupt Configuration: OFF
Pull Up/Down: No Pull
Slew Rate: Low
Invert: OFF
Qual Sel: Sync
The GPIO INT XBAR is configured as follows:
XBAR Output: GPIO_MUX_124
XBAR Instance: GPIO_INT_XBAR_VIM_MODULE0_0
In the R5F application:
HwiP_Params_init(&hwiPrms);
hwiPrms.intNum = 164;
hwiPrms.callback = irq164_handler;
hwiPrms.args = 0;
hwiPrms.isPulse = TRUE;
hwiPrms.isFIQ = FALSE;
status = HwiP_construct(&gPruIcssHwiObject0, &hwiPrms);
DebugP_assert(status == SystemP_SUCCESS);
HwiP_enableInt(164);
isrpinNum = 124;
bankNum = GPIO_GET_BANK_INDEX(isrpinNum);
gpioBaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(CSL_GPIO0_U_BASE);
GPIO_bankIntrEnable(gpioBaseAddr, bankNum);
In the interrupt handler:
void irq164_handler(void *args)
{
uint32_t isrpinNum = (uint32_t) args;
uint32_t bankNum = GPIO_GET_BANK_INDEX(isrpinNum);
uint32_t intrStatus;
uint32_t gpioBaseAddr;
gpioBaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(CSL_GPIO0_U_BASE);
GPIO_bankIntrDisable(gpioBaseAddr, bankNum);
/* Get and clear bank interrupt status */
intrStatus = GPIO_getBankIntrStatus(gpioBaseAddr, bankNum);
GPIO_clearBankIntrStatus(gpioBaseAddr, bankNum, intrStatus);
/* Notify to PRU1 */
PRUICSS_sendEvent(gPruIcss0Handle, ICSS_INTC_EVENT_62);
PRUICSS_clearEvent(gPruIcss0Handle, ICSS_INTC_EVENT_62);
/* Enable interrupt */
GPIO_bankIntrEnable(gpioBaseAddr, bankNum);
}