Hi, I’m trying to read and write data from an MKS DroneCAN servo connected to the CAN port of a BeagleBone Blue using the CAN protocol. The servo has been configured using the DroneCAN GUI with a default Node ID of 117 and an actuator ID of 10.
I’ve connected the servo to the CAN port of the BeagleBone Blue and provided external power of 7V to the servo. The CAN interface on the BeagleBone Blue is set up and running with a bitrate of 1000000, and the CAN state is in error-active. However, when I use CAN commands like candump can0
or cansend can0
, I’m unable to receive any messages from the servo.
If anyone has any ideas on how to resolve this, it would be very helpful to me.
ok obvious things to check.
Is the bitrate at the correct speed ?
do you have CAN termination resistors at both ends of the CAN bus ?
Yes, the bitrate is set to 1000000 and termination resistors are placed at the CAN bus. I have cross-verified the working of servo using DroneCAN GUI.
Ok so next
What OS/kernel version are you running ?
I don’t own a blue so can’t easily check some things. Looking at the schematic there is a signal S
on the CAN transceiver (pin 8 on U1). If this is high the CAN output is disabled, but you should still be able to see CAN. It is connect to pad M16 on the chip, I assume it is a GPIO pin. I would imagine that the devicetree file will have this configured somewhere. I believe in newer kernels the driver can enable a phy chip if required. In older versions I don’t believe it can.
Are you loading a CAN overlay ?
Yes, CAN overlay is enabled in /boot/uEnv.txt file and currently I’m using bone-debian 10.11 emmc flasher version. OS and kernel version being as shown in below image.
ok so if the interface actually up ?
Without setting the GPIO pin you will probably only be able to receive CAN.
If the Beagle is the only other device on the CAN bus, it won’t be able to ack CAN messages if you don’t enable transmits.
Does the Beagle and the servos have a common ground connection ?
The CAN interface is up and functioning correctly, with the BeagleBone Blue and the MKS DroneCAN servo sharing a common ground. I have verified the CAN operation using a NEO3 Pro DroneCAN GPS, where CAN messages were received on the terminal. Additionally, the CAN port on the BeagleBone Blue was confirmed to work properly through a loopback test, and the servo functions well when tested via the DroneCAN GUI. However, no data is being received from the servo on the terminal.
Ok bit of a guess here, but if uboot is loading a beaglebone blue specific devicetree file, you should not load the CAN overlay. I think this is overwriting the correct pin muxing as I think the CAN on the blue is connected to different pads and is enabled by default in am335x-boneblue.dts (5.10 kernel) with the correct pin muxing.
If that doesn’t work I would get a DSO and check to see if there is any TX & RX data on the CAN transceiver pin.
Also don’t forget to transmit you need to make sure the DCAN1_SILENT pin low and not floating or high.