DWM3000 + ESP32-S3: TWR Initiator with Interrupts?

I’m trying to use interrupts in the TWR example. I got it to work for the responder, but I’m having a hard time to make it work with the initiator. Only the TX confirmation callback is called, but not the RX frame ok callback. Should the TWR response in the initator be handled in the tx_conf_cb? Did I set the wrong flags?

  dwt_setcallbacks(&tx_conf_cb, &rx_ok_cb, &rx_to_cb, &rx_err_cb, &spi_error_cb, &spi_ready_cb);

  dwt_setinterrupt(
                  SYS_ENABLE_LO_TXFRS_ENABLE_BIT_MASK |
                  SYS_ENABLE_LO_RXFCG_ENABLE_BIT_MASK |
                  SYS_ENABLE_LO_RXFTO_ENABLE_BIT_MASK |
                  SYS_ENABLE_LO_RXPTO_ENABLE_BIT_MASK |
                  SYS_ENABLE_LO_RXPHE_ENABLE_BIT_MASK |
                  SYS_ENABLE_LO_RXFCE_ENABLE_BIT_MASK |
                  SYS_ENABLE_LO_RXFSL_ENABLE_BIT_MASK |
                  SYS_ENABLE_LO_RXSTO_ENABLE_BIT_MASK,
                  0,
                  DWT_ENABLE_INT);

Never mind. Turns out it works as expected. I had to disable the (non-event driven) processing in the main loop, then the rx_ok_cb was called.

Hi,

Did you use Arduino code or esp-idf? I am looking for ported code that will run with esp-idf on ESP32-S3