0

I have a problem sending data to can1. The CAN transceiver I am using is TJA1050 High speed CAN transceiver. I connected the CAN transceiver to PCAN-USB Pro analyzer that can also send/receive a message. I have followed the tutorial steps from this post on how to use CAN in Beaglebone Black: https://www.thomas-wedemeyer.de/de/electronic/arm/beaglebone/canbus-python/

Based from the guide, this is the configuration steps I did: sudo config-pin p9.24 can sudo config-pin p9.26 can sudo ip link set can1 up type can bitrate 250000 sudo ifconfig can1 up

I've checked the can1 status using command ip -det link show can1: can1 initial state = ERROR-ACTIVE

I dumped the results of candump logs run in background in a file using command candump can1 > candump.log & and I have also attached an oscillator pin in P9.24 to check if it will send a data(voltage changes).

When I send a sample data using cansend cansend can1 100#FF.00.FF.11.22 (CAN MSG ID:100, CAN data:FF.00.FF.11.22 only sample values) there are no results in the candump.log file and there is also no change in voltage in the oscilloscope reading. I checked the can1 status again and it is now in BUS-OFF state, this means there is either a bit error or acknowledgement error. can1 state = BUS-OFF Oscilloscope reading, no change in voltage

My guess is that when data is written the bus bit error occurred because it cannot write the data to the bus. It also seems unlikely to be an acknowledgment error since I did not see data being transferred by the oscilloscope reading. Perhaps there are some configurations to enable the can bus or other configurations not listed in the guide that I've missed?

Your help is highly appreciated.

I've tried other possible solutions from similar asked questions but still cannot fix the problem. Similar asked questions: https://github.com/beagleboard/bb.org-overlays/issues/158 https://forum.beagleboard.org/t/bbb-can-tx-only-works-at-loop-situation/31006/12 BeagleBone Black(BBB) CAN TX packet shows zero count

Ken White
  • 123,280
  • 14
  • 225
  • 444
KUJI
  • 1
  • 2
  • Is there only 1 node on the bus? [What are the most common causes of CAN bus communication errors?](https://electrical.codidact.com/posts/276251) – Lundin Apr 13 '23 at 06:39
  • First is the beaglebone black and the second is PEAK PCAN-USB Pro which is a CAN analyzer but also can send/receive data. Here is the link to the product: https://www.microport.com.tw/prod/CAN-Bus-%E6%8E%A7%E5%88%B6%E5%99%A8%E5%8D%80%E5%9F%9F%E7%B6%B2%E8%B7%AF/USB-to-CAN/PCAN-USB%20Pro%20FD.html – KUJI Apr 13 '23 at 07:04
  • Is the CAN analyzer configured as an active node or passive listener? The latter is often the default setting. – Lundin Apr 13 '23 at 07:32
  • Hello Lundin, thank you for the prompt answer and help, unfortunately there is no way to check in analyzer whether the node in analyzer is active or passive. However, I have tried NXP S32K144EVB board with built in can transceiver and I was able to successfully send/receive data. However the CAN driver implementation for NXP is bare-metal and different implementation(don't care for another node to be present to send data?) – KUJI Apr 13 '23 at 08:41
  • It's a bad analyser if it doesn't support this basic functionality. Anyway, it's sufficient to have another active CAN node to ACK frames, even if it doesn't do anything meaningful otherwise. What you need is an active _CAN controller_, not just a transceiver. So yeah if you have some old eval board laying around, that will do just fine. Although you need to enable the CAN peripheral and configure the correct baudrate. – Lundin Apr 13 '23 at 08:54
  • Hello, I tried connecting it in this way: CAN analyze, NXP S32K144EVB, TJA1050. I was able to send and receive data from CAN analyzer and NXP board but in candump of beaglebone black it is empty (did not receive anything) – KUJI Apr 19 '23 at 07:09

1 Answers1

0

to other people who are having the same experience as me you can try the temporary solution I did. Beaglebone Black CAN driver supports can0 and can1

Can0: P9.19 Rx P9.20 Tx

Can1: P9.24 Rx P9.26 Tx

I checked if I can send Tx packet in Can0 (P9.20 Pin) and it works. Note: I only used the already created firmware image by Beaglebone.org (debian 9.5) I don't have a cape attached to the board I did not modify any dtb or add any overlay

For some reason can0 pins are working correctly compared to the can1 pins so i decided to just use can0 and attached the CAN transceiver (TJA1050) to it.

KUJI
  • 1
  • 2