I’ve been following this guide trying to get the CAN interface to work – no luck.
I see the devices in /proc/device-tree/..., i can memset the values into the registers (tho i use memset without busybox – but AFAICT this shouldn’t be a problem), i load the kernel modules, create the network devices with ip but i’m unable to get the loopback test to run. Pinmux has been adjusted to work with CAN GPIO ports.
Erronous behaviour shows itself as follows:
after a couple of cansend commands i get a “write: No buffer space available” error message – none of the messages are received
meanwhile dmesg is filled with messages like these:
[ 683.464785] mttcan_handle_bus_err: 47958 callbacks suppressed
[ 683.464875] mttcan c310000.mttcan can0: Acknowledgement Error Detected
[ 683.465339] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x76b
[ 683.465524] mttcan c310000.mttcan can0: Acknowledgement Error Detected
[ 683.465719] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x77b
[ 683.465887] mttcan c310000.mttcan can0: Acknowledgement Error Detected
[ 683.466102] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x77b
[ 683.466278] mttcan c310000.mttcan can0: Acknowledgement Error Detected
[ 683.466444] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x77b
[ 683.466620] mttcan c310000.mttcan can0: Acknowledgement Error Detected
[ 683.466784] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x77b
[ 687.467946] mttcan c310000.mttcan can0: bitrate error 0.2%
[ 687.468257] mttcan c310000.mttcan can0: Bitrate set
[ 693.272853] mttcan_controller_config: ctrlmode 31
[ 693.272956] mttcan c310000.mttcan can0: Bitrate set
Detailed list of steps i made:
configure jetson-io for GPIO CAN pin usage
cat /proc/device-tree/mttcan@c310000/status
“okay”
installed devmem2
devmem2 0x0c303018 w 0x458
pinmux can0 DIN
devmem2 0x0c303010 w 0x400
pinmux can0 DOUTM
modprobe can
modprobe can_raw
modprobe mttcan
ip link set can0 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
Thanks in advance for any input. Did i miss something? Did i misinterpret your guides/tutorial?
I tried the loopback test but failed. When measuring electronically we can see the CAN messages being sent but the driver seems unable to receive (or even ACKnowledge) the messages.
before you insert CAN BUS subsystem support module, and Raw CAN protocol module.
did you enable kernel support for mttcan? you should configure deconfig to change CONFIG_MTTCAN = m, so mttcan is compiled as a module
besides,
are you able to check the interface statistics?
for example, ip -details -statistics link show can0 ip -details -statistics link show can1
as described in my first message, i load mttcan (as a module) with the command modprobe mttcan. since i get no error and see the module being loaded (i check with lsmod | grep can) i’m positive the kernel can load the mttcan module. or did i misinterpret your question?
do i actually need to compile the kernel myself (as hinted by you with your defconfig comment)?
No, the issue is not resolved. We’ve been able to confirm that CAN Bus 0 does NOT work on Jetson Xavier AGX machines. The TX Pin does not seem to be able to drive sufficient voltage differentials, as you can see in the image attached.
On top is the differential line driven by an external converter; since the TX pin (seen on bottom) only achieves a differential of 1.6V the converter cannot generate the desired differential signal.
We were able to reproduce this with a second Jetson Xavier AGX.