Coder Social home page Coder Social logo

CAN bus problems about moped HOT 2 OPEN

arndtjonasson avatar arndtjonasson commented on July 26, 2024
CAN bus problems

from moped.

Comments (2)

arndtjonasson avatar arndtjonasson commented on July 26, 2024

The two available CAN bus drivers for Linux on Raspberry Pi were not implemented well in kernel version 3. In kernel version 4, the driver is included from the start and seems to work well.

One identified problem on the VCU is that the Adc, which uses SPI just as the CAN controller does, interferes with the logic for handling the CAN bus. If you don't use the Adc, disable the code for it, for example by letting the function IoHw_Read_AdcSensor return without doing anything.

Another cause of problems was that there could arrive CAN messages in the controller while the interrupt routine was running (in buffer 1, when the original interrupt was for buffer 0), and these would never be read, essentially disabling CAN for the node.

With that, the original problems in this issue have been taken care of (even if the best solution is not known yet).

The logic for receiving plugins on the ECU's relies on not much else happening. It needs to buffer the incoming data at a much earlier stage (in the interrupt routine) or use the full CanTp protocol. Currently, installing a new plugin will fail if there is "a lot" going on on the CAN bus at the same time. I think this is the only remaining problem with CAN bus as such. Some code has reentrance problems when receiving data coming over the CAN bus, such as publishing from two sources to the Ecm at the same time.

from moped.

arndtjonasson avatar arndtjonasson commented on July 26, 2024

I am not sure anymore that there are reentrancy problems in the Ecm, but the code for receiving CAN packages would also be helped by a real CanTp receiver when VCU and SCU both publish at the same time. For now, a fix is to keep waiting for the one that came first, so we at least get some package right. In practice, now, few publishing packages are lost.

from moped.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.