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);}
}