Questions tagged [can-bus]

Controller Area Network (CAN) bus is a networking technology typically used in cars and other vehicles. It supports deterministic priority arbitration with multiple transmitting nodes.

The CAN bus is a serial bus that allows multiple masters and uses a broadcast model. A message start with an ID, can contain up to eight data bytes (64 data bytes for CAN FD) and uses non-return-to-zero encoding. Each node can receive, but only one can send at each point in time. It uses CSMA/CA algorithm for bus access. The lower the (numerical) ID, the higher the priority. Short networks (below 40 m) can achieve bit rates up to 1 Mbit/s.

A distinguishing feature of CAN is that when two nodes with different message identifiers attempt to transmit at the same time, there are no collisions (CSMA/CA). The higher priority message will go through without any need for the sender to re-transmit it. This ensures that a CAN system can never get into a live lock state in which two nodes would continually re-send the same two messages, and continually collide with each other.

A newer version/generation called CAN FD was recently developed. It supports higher clocking of the data portion of the message, allowing up to 64 bytes of payload.

Tag usage:

  • Use this tag for all questions related to CAN or CAN FD software/firmware: drivers, controllers, communication, frames etc. Please note that hardware questions are off-topic and should be asked at https://electronics.stackexchange.com instead.
  • It is recommended to combine the tag with , to draw more attention to the question from the right kind of people.
  • If you are using a particular programming language (say, ), you should add that tag as well.
  • If the question is about higher layer protocols such as CANopen, J1939 or DeviceNet, the tag should be combined with the applicable higher layer protocol tag.

Links:

1162 questions
-1
votes
1 answer

Module can not found in directory /lib/modules/5.15.90.1-microsoft-standard-WSL2

I'm having trouble setting up my CAN environment and using ICSim. I'm new to Linux. This is the first thing I've ever tried. I set up my WSL following this link. I am primarily following this article to set up the CAN interface. Everything looks…
-1
votes
1 answer

modify CRC field in CAN frame

To generate error on CAN, I've done change data field. But It seems just change numerical things. I want to know how to modify CRC field to inject error. Can I change that field with software?. I want to add some anomalies to corrupt the CRC field…
jiji
  • 1
  • 3
-1
votes
1 answer

Is that posible to use two windows form in C# and both windows forms share the same serialPort?

I am using a C# "Windows Form App" to send CAN messages via RS232. in "Form1" i am receiving and sending CAN- masseges by using timers. Since my "Form1" is quite full, I would like to know if it is possible to use two windows forms while still using…
-1
votes
1 answer

FlexCan Ports on a TS-7250-V3 Board

I am communicating using a Canbus port on my TS-7250-V3 embedded controller board. At first, I was using my code which implements the Linux SocketCAN interface, and saw continuous bus activity once I sent out the first Can packet. I had one device…
-1
votes
1 answer

STM32 CAN controller gets arbitration lost transmitting at 500 Kbit/s

My APB1 clock is reported by the STM32 library as being 36MHz. I used a website to calculate a prescaler value of 3 (4 with the automatic +1), BS1 of CAN_BS1_15tq and BS2 of CAN_BS2_2tq. When I use the values in a quick spreadsheet calculation they…
AlastairG
  • 4,119
  • 5
  • 26
  • 41
-1
votes
1 answer

Synchronous Counter Overflow ""CANopen""

I faced a new parameter for synchronization in CANopen: Synchronous Counter Overflow. Synchronous Counter Overflow The synchronous counter overflow object is an object dictionary entry that defines the maximum value of the SYNC counter. The SYNC…
Sajadi
  • 154
  • 1
  • 12
-1
votes
1 answer

Enable use CAPL browser in CANoe

I can't find CAPL browser under Tools Even I can't add and remove Node How should I solve this problem?
wyh
  • 1
  • 1
-1
votes
1 answer

How to install a rx callback with python-can?

I'd like to have a function to receive incoming CANbus frames asynchronously. I wrote the following, but the following issue: can.rxcallback(0, callback) AttributeError: module 'can' has no attribute 'rxcallback' My code is as follow: def…
Stéphane de Luca
  • 12,745
  • 9
  • 57
  • 95
-1
votes
1 answer

How to send data over CAN-Bus using ESP32 Module using MicroPython?

I have an ESP32 module connected to my computer. I am using Thonny IDE to program my ESP32 device using micropython code. I am trying to send data over CAN bus but I m getting error. code: from machine import CAN can = CAN(mode=CAN.NORMAL,…
Alok Mishra
  • 694
  • 5
  • 20
-1
votes
1 answer

tcan4x5x driver returns -22 probe failed error

I am using tcan4x5x driver in Linux kernel v4.14.98, I am facing the below issue [ 27.788175] tcan4x5x spi0.0: Unsupported version number: 0 [ 28.034275] [] tcan4x5x_can_probe+0x318/0x550 [ 28.085188] []…
Aysha
  • 39
  • 2
-1
votes
1 answer

Issue related to CAN protocol? do I need to use CAN?

We are building Electric Vehicle for Formula students competition, for communication protocol between modules we have to use CAN method. Do we need every module to know data from the other modules. For eg. we are using Micro-controller raspberry pi…
user15431285
-1
votes
1 answer

CAN bus off condition info

When Bus off state occurs, assume because of failure of can controller in one node, then how other nodes will come to know that the bus is in off state? Can anybody aware of this?
-1
votes
1 answer

Reading CAN message (PCAN-Router Pro FD)

please I have a problem with writing a code which will read a CAN message, edit it (limit to some maximum value) and then send back with same ID. I´m using PCAN-Router Pro FD and will show you their example of such thing - basically same as mine but…
Huvy
  • 1
  • 1
-1
votes
1 answer

How to read multiple OBD-2 CAN sensor data simultaneously with 2 PCBs

I'm currently using an STN2120 on a custom slave PCB that will be plugged into the OBD-2 port of a vehicle. The STN will be interpreting the CAN protocols, and passing engine sensor information to a master PCB via UART. The ATMEGA2560 MCU on the…
Andrew
  • 33
  • 5
-1
votes
2 answers

Command "ip link show" saving the results to a variable in C language

I am using the command ip -details -statistics link show can0 My result : re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 15 13 0 numtxqueues 1 numrxqueues 1 gso_max_size…
Domi Nik
  • 1
  • 2