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

  • There is no overlap that I can see between uart and GPIOTE pins. If I put some uart sends before the while(SendData == 0) loop and comment the loop out, the data gets sent and I keep getting GPIOTE interrupts. The moment I put the SenData() loop back, the gpiote interrupts stop again. All it does in that loop is wait for some bytes from the host uart before proceeding, and it is definitely getting those bytes and then proceeding so the SendData loop is doing it's job. Very strange, maybe its some other factor I haven't considered.

    Question, do you think I should install the latest SDK, and if I do, how much work will I probably need to do to get my project working with it and the latest softdevice etc? I am a bit terrified to change anything as the whole environment seems very complicated to me.

Reply
  • There is no overlap that I can see between uart and GPIOTE pins. If I put some uart sends before the while(SendData == 0) loop and comment the loop out, the data gets sent and I keep getting GPIOTE interrupts. The moment I put the SenData() loop back, the gpiote interrupts stop again. All it does in that loop is wait for some bytes from the host uart before proceeding, and it is definitely getting those bytes and then proceeding so the SendData loop is doing it's job. Very strange, maybe its some other factor I haven't considered.

    Question, do you think I should install the latest SDK, and if I do, how much work will I probably need to do to get my project working with it and the latest softdevice etc? I am a bit terrified to change anything as the whole environment seems very complicated to me.

Children
No Data
Related