nPM1300 interrupt line always stays high even after clearing events

Hi,

I am currently trying to enable the GPIO output interrupt functionality on my nPM1300ek with an STM32. However, I am unable to get it work correctly(I was only able to get it working with nRF52dk with the NPMX API and device tree). I am using GPIO2 as the interrupt output pin, but after enabling any one of the interrupt, the GPIO line immediately gets pull high (observed using a logic analyzer) and there is no way for me to reset it even after clearing the interrupt event in the register. In general, I would like to know if there are any extra registers that I would need to write (in init function or in the GPIO interrupt handler) to get this working correctly.

Here are the pseudo I2C code that I am using to configure the interrupt

pmic_write(0x0602, 0x5) // Set GPIO2 to output interrupt

pmic_write(0x0018, 0x1); // VBUS Interrupt Enable Set

Thanks!

Parents
  • Update: 

    What we do in the zephyr driver before enabling an interrupt is clear the corresponding event first. 

    setup:
    pmic_write(0x602, 0x5);  // Set GPIO2 to output interrupt
    pmic_write(0x017, 0x1);  // Clear the event
    pmic_write(0x018, 0x1);  // Enable interrupt on the event
    
    and then in the interrupt 
    
    pmic_write(0x017, 0x1);  // Clear the event
    do_stuff();

    We would also recommend verifying that the handler is actually executed as it might also be an misconfigured interrupt input on the host side. 

    Regards

    Runar

Reply
  • Update: 

    What we do in the zephyr driver before enabling an interrupt is clear the corresponding event first. 

    setup:
    pmic_write(0x602, 0x5);  // Set GPIO2 to output interrupt
    pmic_write(0x017, 0x1);  // Clear the event
    pmic_write(0x018, 0x1);  // Enable interrupt on the event
    
    and then in the interrupt 
    
    pmic_write(0x017, 0x1);  // Clear the event
    do_stuff();

    We would also recommend verifying that the handler is actually executed as it might also be an misconfigured interrupt input on the host side. 

    Regards

    Runar

Children
No Data
Related