I am trying to get jremington / UWB-Indoor-Localization_Arduino code to work.
This is the error information I am getting:
Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1).
Core 1 register dump:
PC : 0x40088e73 PS : 0x00060635 A0 : 0x8008999c A1 : 0x3ffbfa5c
A2 : 0x3ffba1e0 A3 : 0x3ffb81a0 A4 : 0xb33fffff A5 : 0x00060623
A6 : 0x3ffc2f64 A7 : 0x0000abab A8 : 0x3ffb81a0 A9 : 0x00000018
A10 : 0x00000018 A11 : 0x0000008e A12 : 0xb33fffff A13 : 0x3f40d0f0
A14 : 0x00000003 A15 : 0x0000abab SAR : 0x0000001e EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x400832f9 LEND : 0x40083301 LCOUNT : 0x00000027
Core 1 was running in ISR context:
EPC1 : 0x400de157 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x00000000Backtrace: 0x40088e70:0x3ffbfa5c |<-CORRUPTED
Core 0 register dump:
PC : 0x4008594d PS : 0x00060035 A0 : 0x80088534 A1 : 0x3ffbf32c
A2 : 0x00000000 A3 : 0xb33f5454 A4 : 0x0000abab A5 : 0x3f40d06c
A6 : 0x00000000 A7 : 0x3ffb6ddc A8 : 0x007bddd0 A9 : 0x3ffbddd0
A10 : 0x003fffff A11 : 0x00060b23 A12 : 0x00060b20 A13 : 0x3f40d06c
A14 : 0x00000000 A15 : 0x0000cdcd SAR : 0x00000019 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000Backtrace: 0x4008594a:0x3ffbf32c |<-CORRUPTED
ELF file SHA256: 0813952bb
I am using ESP32_UWB_setup_anchor on an ESP32-Module:
#include <SPI.h>
#include "DW1000Ranging.h"
#include "DW1000.h"
// ESP32_UWB pin definitions
#define SPI_SCK 18
#define SPI_MISO 19
#define SPI_MOSI 23
#define DW_CS 5
// connection pins
const uint8_t PIN_RST = 27; // reset pin
const uint8_t PIN_IRQ = 34; // irq pin
const uint8_t PIN_SS = 5; // spi select pin
char this_anchor_addr[] = "84:00:22:EA:82:60:3B:9C";
float this_anchor_target_distance =7; //measured distance to anchor in m
uint16_t this_anchor_Adelay = 16600; //starting value
uint16_t Adelay_delta = 100; //initial binary search step size
void setup()
{
Serial.begin(9600);
while (!Serial);
//init the configuration
SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
DW1000Ranging.initCommunication(PIN_RST, PIN_SS, PIN_IRQ); //Reset, CS, IRQ pin
Serial.print("Starting Adelay "); Serial.println(this_anchor_Adelay);
Serial.print("Measured distance "); Serial.println(this_anchor_target_distance);
DW1000.setAntennaDelay(this_anchor_Adelay);
DW1000Ranging.attachNewRange(newRange);
DW1000Ranging.attachNewDevice(newDevice);
DW1000Ranging.attachInactiveDevice(inactiveDevice);
//Enable the filter to smooth the distance
//DW1000Ranging.useRangeFilter(true);
//start the module as anchor, don't assign random short address
DW1000Ranging.startAsAnchor(this_anchor_addr, DW1000.MODE_LONGDATA_RANGE_LOWPOWER, false);
}
void loop()
{
DW1000Ranging.loop();
}
void newRange()
{
static float last_delta = 0.0;
Serial.print(DW1000Ranging.getDistantDevice()->getShortAddress(), DEC);
float dist = DW1000Ranging.getDistantDevice()->getRange();
Serial.print(",");
Serial.print(dist);
if (Adelay_delta < 3) {
Serial.print(", final Adelay ");
Serial.println(this_anchor_Adelay);
// Serial.print("Check: stored Adelay = ");
// Serial.println(DW1000.getAntennaDelay());
while(1); //done calibrating
}
float this_delta = dist - this_anchor_target_distance; //error in measured distance
if ( this_delta * last_delta < 0.0) Adelay_delta = Adelay_delta / 2; //sign changed, reduce step size
last_delta = this_delta;
if (this_delta > 0.0 ) this_anchor_Adelay += Adelay_delta; //new trial Adelay
else this_anchor_Adelay -= Adelay_delta;
Serial.print(", Adelay = ");
Serial.println (this_anchor_Adelay);
// DW1000Ranging.initCommunication(PIN_RST, PIN_SS, PIN_IRQ); //Reset, CS, IRQ pin
DW1000.setAntennaDelay(this_anchor_Adelay);
}
void newDevice(DW1000Device *device)
{
Serial.print("Device added: ");
Serial.println(device->getShortAddress(), HEX);
}
void inactiveDevice(DW1000Device *device)
{
Serial.print("delete inactive device: ");
Serial.println(device->getShortAddress(), HEX);
}
I have tried changing the SPI bus speed to 40MHz and have powered the peripheral with an exterior power supply during compiling. I have also played with the Flash mode in the IDE settings. Thank you!