This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

gpiote interrupt never gets hit

Hi, I set up a 2 GPIOTE interupts like this:

in main.c:

APP_GPIOTE_INIT(3);
err_code = app_gpiote_user_register(&mainUser, 0x00000000, (1 << RF_GPIO2), powerButtonInt); APP_ERROR_CHECK(err_code);
err_code = app_gpiote_user_enable(mainUser);
APP_ERROR_CHECK(err_code);

and then later in another file:

uint32_t err_code;
err_code = app_gpiote_user_register(&radioUser, 0x00000000, (1 << RF_GPIO0), radioInt);
APP_ERROR_CHECK(err_code);
err_code = app_gpiote_user_enable(radioUser);	//leave it disabled for now
APP_ERROR_CHECK(err_code);

But my interrupt functions never get hit. I cannot understand why. Any idea where I can start to look?

Parents
  • Ok, so I see that if I do get GPIOTE interrupts working just fine, if I comment out some (necessary) serial comms code in between initialising the SoftDevice and proceeding with my app. If I uncomment what is commented out below, I never get the GPIOTE interrupt. How can that be?

    APPL_LOG("init SD\n\r");
    InitSoftDevice();
    InitHardware();     //this is where GPIOTE interrupts get set up
    
    //while(SendData == 0)
    //{
    //  if(HostDetected == 0)               //HostDetected is set to 1 when the host replies to below
    //  {
    //    app_uart_put(0xAA);		//lets the host know this MCU is ready for comms
    //    app_uart_put(VERSION);
    //    nrf_delay_ms(50);
    //  }
    //}
    
    nrf_delay_ms(10);		//allow the ACK to be sent via serial port
    

    --proceed with application

  • FormerMember
    0 FormerMember in reply to the_purple_pig

    Which version of the SDK do you use?

    Could you share your main.c?

Reply Children
No Data
Related