Hi
I’m currently working on a project for my university and I’m having trouble using interrupts with the dw3000 board with an ESP32 wrover B.
I’m using the legacy Arduino IDE. The Arduino version is 1.8.19 and the gcc version is 11.4.0.
I cloned the repository of the lib from GitHub - Makerfabs/Makerfabs-ESP32-UWB-DW3000. Added it to the Arduino library dir.
Now I wanted to use deep sleep when sending some data every x seconds to reduce power consumption in my scenario. To do this I wanted to use interrupts to complete the transmission and wake up the system.
I used the example for sending data in the repository (simple_tx) and added two callbacks to handle the interrupts.
dwt_setcallbacks(&txDoneHandler, NULL, NULL, NULL, NULL, &readyHandler);
Next I called
dwt_setinterrupt(SYS_ENABLE_LO_SPIRDY_ENABLE_BIT_MASK | SYS_ENABLE_LO_TXFRS_ENABLE_BIT_MASK, 0 , DWT_ENABLE_INT );
I then cleared the status bits and sent data, which works. But the callbacks are never called. My first problem was that when I called dwt_setinterrupt I got an Illegal Instruction Exception and the system rebooted. With the help of debugging tools I found out that the problem must be in the function decamutexon(), which disables interrupts and saves the current state. The function is declared to return a value, but it doesn’t. If I change it to return something like NULL, the crash is gone, but the interrupts still don’t work. So there seems to be something wrong with the compiler?
Ignoring this error, what am I doing wrong in handling interrupts, is there a flag that needs to be set ?