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.

RTOS/AM5728: HWI setup problem

Part Number: AM5728


Tool/software: TI-RTOS

I am trying to setup a HWI, with AM5728, GPIO4 PIN11. 

Here is my code 

===================================

*((volatile INT32U*)GPIO4LEVEL1) = (1<<11);
*((volatile INT32U*)GPIO4IRQCLR0) = (1<<11);
*((volatile INT32U*)GPIO4IRQSET0) = (1<<11);

Hwi_Params_init(&hwiParams0);
hwiParams0.eventId = 27;  //TRM P4128 table 17-3 GPIO1 IRQ
hwiParams0.arg = 0; // 
hwiParams0.maskSetting = Hwi_MaskingOption_SELF;
hwiParams0.enableInt = TRUE; 
hwi0 = Hwi_create(11, MBUS_Isr, &hwiParams0, &eb);
if(hwi0 == NULL)
{
printf("GPIO Hwi create failed !\n");
}

===================================

as Table 17-3. DSP1_INTC Default Interrupt Mapping,

GPIO4_IRQ_1 default input index is 27. 

It pass the error check, but the HWI did not trigger when GPIO4P11 is set high. 

I writet the GPIO_IRQSTATUS_RAW_0 bit 11 to be 1 didn't work either.

What had I miss?

  • The RTOS team have been notified. They will respond here.
  • Hi,

    There are several things to check:

    1. Is this on TI AM572x GP or IDK EVM? Or you own customized board?

    2. Do you enable the PRCM domain of GPIO4?

    3. Do you have correct PINMUX setting of this GPIO4 and PIN 11?

    4. Then for the code you showed, we have GPIO LED blinking example on AM5728 IDK EVM, on C66x core. Please see: GPIO_LedBlink_idkAM572x_c66xTestProject

    If you have older Rev 1.2 Rev, it uses

    /* GPIO Defintions specific Rev1p2 Board */

    /* GPIO pin number connected to the green LED */

    #define GPIO_GRN_LED_PIN_NUM_1P2   (0x04)

    /* GPIO port number connected to the green LED */

    #define GPIO_GRN_LED_PORT_NUM_1P2  (0x04)

    /* GPIO pin number connected to the yellow LED */

    #define GPIO_YEL_LED_PIN_NUM_1P2   (0x05)

    /* GPIO pin number connected to the yellow LED */

    #define GPIO_YEL_LED_PORT_NUM_1P2  (0x04)

    If you use current Rev 1.3 board, it uses

    /* GPIO Defintions specific Rev1p3 Board */

    /* GPIO pin number connected to the green LED */

    #define GPIO_GRN_LED_PIN_NUM_1P3    (0x17)

    /* GPIO port number connected to the green LED */

    #define GPIO_GRN_LED_PORT_NUM_1P3   (0x07)

    /* GPIO pin number connected to the yellow LED */

    #define GPIO_YEL_LED_PIN_NUM_1P3    (0x16)

    /* GPIO pin number connected to the yellow LED */

    #define GPIO_YEL_LED_PORT_NUM_1P3   (0x07)

    So you can use the program to try on the EVM and it is very close to your case just different GPIO bank/pin. Look at the working case, make a snapshot of the GPIO registers to see if any difference in your failing case: like input or output, level or edge trigger, and if interrupt enabled.

    You can also look at the GPIO_v1_hwAttrs in the  pdk_am57xx_1_0_11\packages\ti\drv\gpio\soc\am572x\GPIO_soc.c to understand the interrupt number used. For example, in the working case Rev 1.3B board, when using GPIO7, the eventCombiner on DSP ROV view is "61", in your case should be "58" for your GPIO4.

    You can also look at GPIO_setConfig_v1() in pdk_am57xx_1_0_11\packages\ti\drv\gpio\src\v1\gpio_v1.c to see how the interrupt is created.

    Regards, Eric

  • Thanks for help, after change the evenId to 58, the HWI work now.