How to Fix CAN Controller Initialization Error in ATmega2560 with Zephyr OS?

Hey guys, I am trying to implement a real-time control system for automotive applications using an ATmega2560 microcontroller, an MCP2515 CAN controller, and Zephyr OS, while integrating a Bosch BMP280 sensor for pressure data. How can I address the error of failing to initialize the CAN controller? I have tried configuring the SPI peripheral in Zephyr, integrating the MCP2515 CAN controller, and the Bosch BMP280 sensor, but I still encounter the error "CAN: Device driver not found."

If the implementation is successful, the output should log a message indicating that the CAN frame has been sent successfully.
Here is my code in the attached file.
file0.jpg
Solution
Yeah, I was able to redefine the MCP2515 CAN controller in the device tree file and also confirmed that the MCP2515 CS pin is correctly configured. I've been able to get a lead on it, thanks buddy @RED HAT
Was this page helpful?