DW1000 frame not sent

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

Hi @jraero ,

Did you call dwt_isr when DW1000 IRQ line triggered ?

Best Regards,
TN

Hi @leapslabs ,

I am not using dwt_isr() but the code is equivalent – it clears the status bits and calls dwt_forcetrxoff() and dwt_rxreset() in case of timeouts and RX errors.

After more debugging I found out that most of the times the blink frame is sent but the receiver does not get turned on afterwards, as evidenced by the respective SYS_CTRL, SYS_STATUS and SYS_STATE bits. When this happens, the IC also clears all SYS_MASK bits.

This happens at seemingly random times and the system can be running for hours before the issue appears.

For now, I am working around this by starting a timer when the blink is sent and resetting the chip if there is no IRQ from the DW1000 when it expires.

Thanks,
Jānis

Hi @jraero ,

Can you try example ex_03a_tx_wait_resp or ex_03d_tx_wait_resp_interrupts in this package https://www.decawave.com/wp-content/uploads/2019/01/dw1000_api_rev2p14.zip to see if the issue still happens ?

Best Regards,
TN