Problem to trigger Interupts

Hi,
Im new to programming and tried to work with the DWM-1001-dev board and the given examples.
My current program for reading frames is based on polling. After that I send a response frame. To archive better response timing I wanted to control the receiving of frames with interrupts.
For the first steps I wanted a simple code where I trigger the interrupts.

The code works but unfortunately the system seems to not trigger an interrupt. When I am debugging the code it won’t jump into the callback functions, where I set my Breakpoints. What did I miss and can someone tell me what I did wrong?
Thanks for your help.

static dwt_config_t config = {
5,
DWT_PRF_64M,
DWT_PLEN_64,
DWT_PAC8,
9,
9,
0,
DWT_BR_6M8,
DWT_PHRMODE_EXT,
(129 + 8 - 8)
};

static void rx_ok_cb(const dwt_cb_data_t *cb_data);
static void rx_to_cb(const dwt_cb_data_t *cb_data);
static void rx_err_cb(const dwt_cb_data_t *cb_data);
static void tx_conf_cb(const dwt_cb_data_t *cb_data);
static uint8 rx_buffer[37];
uint8 int_Status;
uint32 int_Mask;

int main(void)
{

boUART_Init ();
reset_DW1000();
port_set_dw1000_slowrate();
if (dwt_initialise(DWT_LOADUCODE) == DWT_ERROR)
{
while (1) {};
}
port_set_dw1000_fastrate();
dwt_configure(&config);
nrf_gpio_cfg_input(DW1000_IRQ, NRF_GPIO_PIN_NOPULL);
dwt_setcallbacks(&tx_conf_cb, &rx_ok_cb, &rx_to_cb, &rx_err_cb);
dwt_setinterrupt(DWT_INT_TFRS | DWT_INT_RFCG | DWT_INT_RFTO | DWT_INT_RXPTO | DWT_INT_RPHE | DWT_INT_RFCE | DWT_INT_RFSL | DWT_INT_SFDT, 1);
while (1)
{
dwt_rxenable(DWT_START_RX_IMMEDIATE);
dwt_readrxdata(rx_buffer, 37, 0);
deca_sleep(1000);
int_Status = dwt_read32bitoffsetreg(SYS_STATUS_ID, 0x00);;
int_Mask = dwt_read32bitoffsetreg(SYS_MASK_ID, 0x00);
}
}

static void rx_ok_cb(const dwt_cb_data_t *cb_data)
{
for( int i=1; i>=5; i++){deca_sleep(10);}
}

static void rx_to_cb(const dwt_cb_data_t *cb_data)
{
for( int i=1; i>=5; i++){deca_sleep(10);}
}

static void rx_err_cb(const dwt_cb_data_t *cb_data)
{
for( int i=1; i>=5; i++){deca_sleep(10);}
}

static void tx_conf_cb(const dwt_cb_data_t *cb_data)
{
for( int i=1; i>=5; i++){deca_sleep(10);}
}

Hi ynad,

Have you setup the interrupt pin on the nrf52832 ?

Basically, when the DW1000 raises an interrupt, it should be processed by the MCU that should call back the dw1000 interrupt service routine.

I suspect you miss something like the code below:

/*DWM1000 interrupt initialization and handler definition*/

/*!
* Interrupt handler calls the DW1000 ISR API. Call back corresponding to each event defined in ss_init_main
*/
void vInterruptHandler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
  dwt_isr(); // DW1000 interrupt service routine 
}

/*!
* @brief Configure an IO pin as a positive edge triggered interrupt source.
*/
void vInterruptInit (void)
{
  ret_code_t err_code;

  if (nrf_drv_gpiote_is_init())
    printf("nrf_drv_gpiote_init already installed\n");
  else
    nrf_drv_gpiote_init();

  // input pin, +ve edge interrupt, no pull-up
  nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);
  in_config.pull = NRF_GPIO_PIN_NOPULL;

  // Link this pin interrupt source to its interrupt handler
  err_code = nrf_drv_gpiote_in_init(DW1000_IRQ, &in_config, vInterruptHandler);
  APP_ERROR_CHECK(err_code);

  nrf_drv_gpiote_in_event_enable(DW1000_IRQ, true);
}

Maybe have a look at the example there which has working interrupt on dwm1001-dev :

Let me know how it goes,
Thanks
Yves

Hi Yves,

Thanks for helping me out. With the new information I can now trigger the interrupts.
From here i can built up my programm. Thanks again, that helped me a lot.