Hi,
I am implementing asymmetric two-way ranging using DW1000 with the ranging exchange initiated by the anchor. If the tag does not receive a poll frame from the anchor for some predefined period of time, it goes back to blinking.
The issue I’m facing is that after a number of times DW1000 does not send the blink frame. None of the Tx-related bits get set in the system status register, the interrupt is never asserted and the code is stuck waiting for an Rx event.
void dw1000_tag_isr() {
uint32_t status = dwt_read32bitreg(SYS_STATUS_ID);
// clear tx status bits to re-enable the interrupt for rx
if (status & 0xF0)
dwt_write32bitreg(SYS_STATUS_ID, 0xF0);
}
void dw1000_tag_init() {
// ...
dwt_setrxaftertxdelay(0);
dwt_setpreambledetectimeout(0);
dwt_write32bitreg(SYS_MASK_ID, SYS_MASK_RXDFR | SYS_STATUS_ALL_RX_ERR | SYS_STATUS_ALL_RX_TO | 0xF0);
// ...
}
void dw1000_tag_loop() {
// ...
if (tag_state == TAG_BLINK) {
dwt_setrxtimeout(UINT16_MAX);
dwt_writetxdata(12, tx_buf, 0);
dwt_writetxfctrl(12, 0, 0);
dwt_starttx(DWT_START_TX_IMMEDIATE | DWT_RESPONSE_EXPECTED);
// wait for rx event
}
// ...
}
(Channel 2 is DW1000 IRQ line)
Reading the system control register shows that the LSB stays 0x82 forever.
Any ideas about what could be causing this?
Thanks,
Jānis