Hello,
I’ve been working on a fork of the Tracker Edge firmware for some time, making use of GPS, BLE and CAN. After refactoring my application code (Implementing runtime polymorphism for CAN nodes, it crashes during the first run of the main loop. (Before the refactoring it was working)
The crash occurs in the can-mcp25x library, in the following function:
byte MCP_CAN::mcp2515_readRegister(const byte address)
{
byte ret;
// If I comment out this transaction there is no crash.
SPI_BEGIN();
MCP2515_SELECT();
spi_readwrite(MCP_READ);
spi_readwrite(address);
ret = spi_read();
MCP2515_UNSELECT();
SPI_END();
return ret;
}
(I have access to a debugger)
How should I go about troubleshooting this?