Run simulation. Use Proteus’s and Logic Analyzer to verify message flow.
, you can test your firmware and circuit logic in a virtual environment before ever touching a soldering iron. Why Use the MCP2515 for Simulation? mcp2515 proteus library