KUJI
KUJI

Reputation: 11

Cannot send CAN data using cansend in CAN1

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

Upvotes: 0

Views: 540

Answers (2)

Maybe your TJA1050 device were disable. In my case when I tried to use CAN1 with my CAN Transceiver module (TJA1043T). I have to set EN and STB_N pin to HIGH level. Otherwise, the CAN would change to bus-off mode.

Upvotes: 0

KUJI
KUJI

Reputation: 11

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.

Upvotes: 1

Related Questions