Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
@Middleware & OS hey guys, I am working on an AVR microcontroller project using Zephyr OS for an IoT device that controls motors via CAN Bus/SPI. The initial error I encountered was “CAN Bus initialization failed.” To address this, I verified the wiring and configuration settings in the Zephyr device tree. Despite this, the error “CAN message send failed” persists. I have studied the Zephyr documentation and relevant AVR datasheets extensively, yet the issue remains unresolved. the outcome should be able to send and receive message via the CAN Bus. Here is a sample code snippet of it:
#include <zephyr.h>
#include <device.h>
#include <drivers/can.h>
#include <drivers/spi.h>
// Function prototypes
void can_init(void);
int can_send(const struct zcan_frame *msg);
int can_receive(struct zcan_frame *msg);
void spi_init(void);
CONTRIBUTE TO THIS THREAD