Code Monkey home page Code Monkey logo

stm32-j1708's Introduction

Usage

You can capture J1708 messages by connecting the STM32 board to the J1708 bus, connecting USB to your computer and running:

$ j1708dump

If you don't want the J1708 messages decoded you can supply the -N option:

$ j1708dump -N

An interactive python frontend is also available:

$ j1708.py -p <port>

A J1708 object called j is created and use to send and receive J1708 messages. More usage information can be found by typing j? and hitting enter at the prompt.

Required Tools

Because the firmware is built using the STM32 Arduino core there are many settings required to get it to build and flash correctly. The following will be needed:

arduino-cli installation instructions can be found here: https://arduino.github.io/arduino-cli/latest/installation/. This code was tested with version 2.0.0 of the Arduino_Core_STM32. That can be installed by connecting the following board manager json file to the Arduino tools:

The arduino-cli and necessary boards can be installed and configured automatically with the install_arduino_cli.sh script. This script installs arduino-cli using go. If you would prefer not to mess with go, install the latest arduino-cli using the instructions on that project's page and the install_arduino_cli.sh script will only install the STM32 board manager files.

Compiling

The firmware can be built and installed by running the following commands in this or the firmware/ directory.

$ make
$ make flash

By default the makefile will use the arduino-cli command line tool to build the firmware dfu-util to flash a "bluepill" STM32F103C8T6 board.

Supported Hardware

STM32F103 "bluepill"

This tool was originally developed using a "bluepill" devboard.

When used with the "bluepill" board you first need to flash an Arduino compatible booloader onto the board since the bluepill does not typically use genuine STM32 processors and do not come with a DFU-compatible bootloader pre-programmed.

Bootloader

This board was programmed with the generic_boot20_pc13.bin Arduino compatible bootloader from the STM32duino project (https://github.com/rogerclarkmelbourne/STM32duino-bootloader/) with this command:

st-flash write bootloader_only_binaries/generic_boot20_pc13.bin 0x8000000

STM32F411 "blackpill"

This tool has been tested with a "blackpill" STM32F411 devboard. When targeting the blackpill use the following commands to compile and flash the target board (if using the makefile and command line arduino-cli tools):

make TARGET=BLACKPILL
make TARGET=BLACKPILL flash

The standard flash method configured in the blackpill_sketch.json is DFU using stm32CubeProg dfu method. So you will need the STM32Cube tools installed before this will work.

If using a blackpill board that is not the STM32F411 board available on Adafruit the sketch.json file will need to be customized, or manually configured and compiled through the normal Arduino IDE.

About

The SAE J1708 code is influenced by:

This code works with an STM32 "bluepill" (STM32F103C8T6) board wired to a copperhill SAE J1708 breakout board on USART1 (PA9 for Tx, PA10 for Rx):

This code is also tested on the "blackpill" (STM32F411) board with the same connections to the J1708 breakout board:

stm32-j1708's People

Contributors

sprout42 avatar

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.