Git Product home page Git Product logo

vi-firmware's Introduction

OpenXC Vehicle Interface Firmware

/docs/_static/logo.png

Version:8.2.1
Web:http://openxcplatform.com
Documentation:http://vi-firmware.openxcplatform.com
Source:http://github.com/openxc/vi-firmware
Keywords:vehicle, openxc, embedded
https://travis-ci.org/openxc/vi-firmware.svg?branch=master https://coveralls.io/repos/openxc/vi-firmware/badge.png?branch=master Documentation Status

The OpenXC vehicle interface (VI) firmware runs on a microcontroller connected to one or more CAN buses. It receives either all CAN messages or a filtered subset, performs any unit conversion or factoring required and outputs a generic version to a USB interface.

For more documentation, see the vehicle interface section on the OpenXC website or the vehicle interface documentation.

Installation

For the full build instructions, see the documentation.

Releasing

  • Make sure you release the Python library first if there are any updates
  • Update script/bootstrap/ci-requirements.txt to use released version at PyPI (i.e. the requirement should be openxc==<latestversion>)
  • Make sure you release the openxc-message-format library first if there are any updates
  • Update the src/libs/openxc-message-format with git submodule update --remote
  • Checkout next branch and make edits.
  • Bump the version using semantic versioning in - CHANGELOG.mkd - README.rst - src/config.cpp - docs/index.rst - docs/conf.py
  • Checkout master, merge in next
  • Run 'fab release', say yes to the tag and use the format v0.9.1
    • This will run the test suite, tag, and push to GitHub
  • Checkout the next branch, and edit the same files to change the version to the next development release (one patch release up with the -dev suffix, e.g. v0.9.2-dev
  • Go to https://github.com/openxc/vi-firmware/releases and promote the tag you just created to a new release - copy and paste the changelog into the description.
    • Attach the openxc-vi-firmware-*.zip from the releases directory to the release on GitHub

License

Copyright (c) 2012-2018 Ford Motor Company

Licensed under the BSD license.

This repository includes links to other source code repositories (as git submodules) that may be distributed under different licenses. See those individual repositories for more details.

vi-firmware's People

Contributors

alokonly avatar creitz avatar cwbaldwin avatar davemelcher avatar dependabot[bot] avatar devan224 avatar dsouzahansenfrancis avatar emarsman avatar genojaford avatar jayanthi-rao avatar jkitch20 avatar jstoke53 avatar kyle-kelly avatar mgiannikouris avatar peplin avatar pjt0620 avatar ppraka30 avatar rhettschaefer avatar rwoberholzer avatar sskinger avatar sudo-a13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vi-firmware's Issues

Enabling CAN acceptance filter in LPC1769 kills all traffic

I wrote a small test program for the LPC1769 that sets up CAN and a single CAN acceptance filter, then sent some CAN traffic at the OBD-II port. This worked fine, it printed out the data for as long as I ran it for the one message only.

I then made sure we were using the same functions in the cantranslator firmware, but when the AF goes on, we get no messages. The CAN interrupt never seems to be called. I simplified it so that only one filter is added, for the same message as the small test program, and still that doesn't work. Switching over to the AF bypass mode, it works fine (but of course we get way too much CAN traffic).

The board is alive (I can query for a version check) but there are no messages received via USB.

Not enumerating as a USB device in Windows

The device will not enumerate properly in Windows 7. On first attach, Windows spins for a bit and then reports "Unrecognized device". After that, nothing shows up in the Device Manager. Looking at the translator itself, it's initializing and then getting reset over and over again.

I looked into which USB event codes are being received on the device, and oddly they are 117 once and 115 multiple times - not the EVENT_CONFIGURED that we expect on other platforms. The details of this are hidden in the Microchip USB stack, so I'm a little stuck there.

Also interesting is that it seems like it's resetting the entire PIC32, not just the USB stack. The green LED goes back to flashing for 5 seconds, which is what I usually expect when it first starts up.

This needs to be fixed before you can use the CAN translator directly from Windows, e.g. with the Python library.

Unpredictable data returned with passthrough handler on LPC1769

With a CAN bus bench test rig sending vehicle data and the LPC1769 based translator flashed with the passthrough firmware, I get good raw passthrough data for 5-10 seconds, then I get about 5 translated OpenXC messages and then it freezes. On the debug log of the translator, it complains that the USB queue is full and ~5 messages are dropped, then it stops.

The translator is not hard faulted, as I can query for the version over USB's EP0 and it works fine.

The translated messages are really, really puzzling - there is no occurrence of a string like steering_wheel_angle anywhere in the code base when building for passthrough and yet it comes up with the value. I was wondering if perhaps it was still in un-erased flash memory on the chip, so I dumped the firmware back to my hard drive. Running strings on it didn't return any results for steering_wheel_angle but I'm not positive this was a complete test.

I added additional debug logging to the Python library to print out the complete message buffer received via USB and not just the successfully parsed messages. When the translated messages do appear and it freezes, we get a lot of what looks like random memory content over USB. It's a bunch of junk, with some translated messages mixed in.

My theory is that in the LPC1769 specific code, we're somehow walking off the end of an array and starting to return invalid memory addresses. Double check this, but I'm fairly certain we don't see this problem when running the CAN emulator, which indicates the problem is most likely in the passthrough-specific or CAN specific code.

Add a section of derived, complex signals to OpenXC

Initially I was thinking that all derived signals belong not in the CAN translator, but in the host device. Now I'm rethinking that, since there could be potentially be other devices reading over USB that aren't using the Android library. It makes sense to have a two lists of signals: simple signals (the current list) and derived signals (e.g. fuel economy in mpg). It lowers the barrier for people who want to do apps with fuel economy.

Also, document how we're calculating each derived signal. Could the handlers even be part of the open soure cantranslator project, since they're just dealing with fully transforme OpenXC values?

Add support for request/response style CAN messages

This is specifically to support reading the standard OBD-II message set. The API needs to be carefully thought out, because these types of messages are significantly different than the normal CAN messages we're currently sniffing.

Code coverage calculation with gcov/lcov incorrect in OS X

In OS X, the code coverage output reports 97% coverage for src/tests and 0% coverage for src. I've compared the output of lcov on Linux and OS X and they are for the most part very similar. The biggest difference is that on OS X the gcov version is 4.2.1 and on Linux it's 4.7.2. Unfortunately there doesn't seem to be an easy way to get newer versions of GCC in OS X as they've deprecated it in favor of clang/LLVM.

Create versions of CAN signal writer functions that accept primatives instead of cJSON objects

The functions that accept cJSON objects are handy for the USB message parser, because it doesn't need to figure out exactly which type of primitive it should be, but there should be version that do accept primitives. This would be used in test cases to start, but in other places in the future - it's just good to not have types from a 3rd party library in your public API.

Check for invalid memory access in test suite

Run the test suite with valgrind to see if there's any invalid memory access. I'm seeing odd memory issues on the LPC1768, and if there's anything that we can identify running in Linux that would be much easier.

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.