I’m trying to setup a CAN bus driver for a jetcat engine.
- It is strongly inspired from CanardNuttXCDev.cpp.
- I configured
CONFIG_CAN=y, CONFIG_STM32F7_CAN1=y, CONFIG_STM32F7_CAN1_BAUD=20000in defconfig
- I don’t want to use uavcan so I commented it in boards/px4/fmu-v5/default.cmake
- I open the CAN port as
_fd = ::open("/dev/can0", O_RDWR | O_NONBLOCK);
- the file descriptor is non null, so the port is open. I am able to read CAN data that are sent from a CAN bus analyzer. So the reading is functional.
But whenever I call write(), the function returns -1, i.e. no bytes are written. And whenever I call
poll(&fds, 1, 100); // 100ms,