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

  • Hi Kristin, I'm using Keul uVision 5.14.00, CMSIS core v 4.1.0, then all the ble and softdevice seem to be 2.0.0. That's what it says in the 'Manage Runtime Environment' bit in Keil at any rate. Under Softdevice, the things in the 'Internal' folder say V1.1.2.

    I';ll attach my main in a minute when I figure out how. Thanks for your help!

Reply Children
No Data
Related