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.

AM5729: bare-metal gpio interrupt on am5729

Part Number: AM5729

Hi,

I'm trying to write a simple program that will call an ISR upon detecting a gpio interrupt (I tried both edge and level). I wrote my code using a CSL example but it doesn't call the callback function. I was wondering whether you can help me figure out what's wrong or if I'm missing a step in configuring the interrupt. what my code wants to do is to detect an interrupt on pin 11 of gpio 3 and read pin10 upon that. please let me know if I'm missing anything. the code runs well but the callback never gets called.

Here is my .c code:

header:

main:

interrupt config ( tried both 26 and 31 as I wasn't sure for gpio3):

isr:

boardpaddelayinit:

  • Hi Amir,

    Have you tried GPIO_ledBlink example available at <PDK_Install_Path>\packages\ti\drv\gpio\test\led_blink\src. You just need to change the base address to CSL_MPU_GPIO3_REGS and pin number to 0x0B and you should be able to trigger the ISR.

    Regards,
    Parth

  • Hi, Thanks for the response. I have but it uses a different method for setting up an interrupt. I want to use csl since it's closer to hardware. I've been trying to figure out the problem and I figured the problem is my callback function doesn't get called because the default handler in csl/arch/src/interrupt.c is getting called. and that's a while loop. I tested my code there by removing the while loop as a temporary hack and I was hoping you could give me some guidance on the correct way of attaching interrupt. 

  • Hi Amir,

    I'll look into your code. Meanwhile, you can refer to the CSL example available at <PDK>\packages\ti\csl\example\gpio\gpio_interrupt

    Regards,
    Parth