All Projects → marcinbor85 → can-prog

marcinbor85 / can-prog

Licence: MIT license
Command-line tool to flashing devices by CAN-BUS

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to can-prog

can-go
Controller Area Network (CAN) SDK for Go.
Stars: ✭ 113 (+71.21%)
Mutual labels:  can, canbus, socketcan
can2mqtt
Bidirectional CAN-Bus to MQTT-Bridge
Stars: ✭ 39 (-40.91%)
Mutual labels:  bus, can, socketcan
NodeMCU-BlackBox
ESP8266 based CAN-Bus Diagnostic Tool
Stars: ✭ 28 (-57.58%)
Mutual labels:  can, canbus
JavaCAN
A simple JNI wrapper for the socketcan API provided by the Linux kernel. As it is wrapping a Linux Kernel API, it is intended for use on Linux only.
Stars: ✭ 23 (-65.15%)
Mutual labels:  can, socketcan
ecu-simulator
OBD-II ECU Simulator
Stars: ✭ 24 (-63.64%)
Mutual labels:  can, socketcan
pyuavcan
Python implementation of the Cyphal protocol stack.
Stars: ✭ 91 (+37.88%)
Mutual labels:  can, socketcan
pcan cantact
🤖 XCAN firmware for CANtact ( CANable ) or any other similar boards.
Stars: ✭ 192 (+190.91%)
Mutual labels:  can, socketcan
openHCAN
Hausautomatisierungsloesung auf CAN-Bus Basis.
Stars: ✭ 16 (-75.76%)
Mutual labels:  can, socketcan
lwpkt
Lightweight packet protocol structure for multi-device communication focused on RS-485
Stars: ✭ 71 (+7.58%)
Mutual labels:  protocol, stm32
Open-SAE-J1939
SAE J1939 protocol free to use for embedded systems or PC with CAN-bus
Stars: ✭ 120 (+81.82%)
Mutual labels:  stm32, canbus
awesome-automotive-can-id
🚜 unpretentious attempt to collect CAN IDs and payloads for various car brands/models in one place.
Stars: ✭ 104 (+57.58%)
Mutual labels:  can, canbus
lwow
Lightweight onewire protocol library optimized for UART hardware on embedded systems
Stars: ✭ 98 (+48.48%)
Mutual labels:  protocol, stm32
PSAVanCanBridge
VAN - CAN protocol bridge (V2C) for cars made by PSA Group (Peugeot, Citroen)
Stars: ✭ 67 (+1.52%)
Mutual labels:  protocol, can
Tinyframe
A simple library for building and parsing data frames for serial interfaces (like UART / RS232)
Stars: ✭ 151 (+128.79%)
Mutual labels:  protocol, stm32
Derosuite
DERO: Secure, Anonymous Blockchain with Smart Contracts. Subscribe to Dero announcements by sending mail to [email protected] with subject: subscribe announcements
Stars: ✭ 216 (+227.27%)
Mutual labels:  protocol
Merkletreejs
🌱 Construct Merkle Trees and verify proofs in JavaScript.
Stars: ✭ 238 (+260.61%)
Mutual labels:  protocol
Framework
0xcert Framework - JavaScript framework for building decentralized applications - build something unique
Stars: ✭ 213 (+222.73%)
Mutual labels:  protocol
Protocol
Enzyme Protocol Implementation
Stars: ✭ 211 (+219.7%)
Mutual labels:  protocol
StriderMqtt
A very thin MQTT client
Stars: ✭ 21 (-68.18%)
Mutual labels:  protocol
Ttrpc
GRPC for low-memory environments
Stars: ✭ 236 (+257.58%)
Mutual labels:  protocol

canprog

Command-line tool to flashing devices by CAN-BUS.

Main features

  • Support STM32 CAN-BUS ROM bootloader
  • Easily expand with other CAN-BUS protocols
  • Support iHEX and binary format files
  • Object oriented architecture
  • Command-line interface
  • Socket-CAN driver for CAN-BUS low level operations

Todo

  • Other microcontroller protocols
  • Other CAN-BUS interfaces
  • Autocalculating sectors for erasing (for STM32)
  • Memory write protect/unprotect (form STM32)
  • TDD tests

Requirements

  • Compatible PC CAN-BUS adapter
  • Linux + Python3
  • Enabled SocketCAN driver
  • Board with STM32 with CAN interface

Driver instalation

modprobe can
modprobe can-raw
modprobe slcan
slcand -o -c -f -s4 /dev/ttyUSB0 slcan0
ip link set up slcan0

App instalation

sudo pip install canprog

Usage:

General usage + configuration

usage: canprog [-h] [--verbose] [--version] [-n NAME] [-i {socketcan}]
               [-f {hex,bin}]
               {stm32} ...

Command-line tool to flashing devices by CAN-BUS.

others:
  -h, --help      show this help message and exit
  --verbose       enable verbose output
  --version       show program's version number and exit

configuration:
  -n NAME         interface name (default: slcan0)
  -i {socketcan}  interface type (default: socketcan)
  -f {hex,bin}    file format (default: hex)

protocols:
  {stm32}
    stm32         STM32 ROM bootloader

STM32 bootloader options

usage: canprog stm32 [-h] {write,read,erase,go,lock,unlock} ...

others:
  -h, --help            show this help message and exit

commands:
  {write,read,erase,go,lock,unlock}
    write               write file to target memory
    read                read target memory to file
    erase               erase target memory
    go                  start program application
    lock                enable readout protection
    unlock              disable readout protection
    speed               change the can baud rate the boot rom uses

Usage examples:

canprog stm32 write image.hex
canprog -f bin stm32 write image.bin -a 0x08000000
canprog stm32 read dump.hex -s 0x200
canprog stm32 lock
canprog stm32 erase -P 0 1 2 3

Example output:

[13:41:25.931] main INFO: Connecting target
[13:41:25.935] stm32 INFO: Bootloader initialized
[13:41:25.944] stm32 INFO: Bootloader version: 2.0
[13:41:25.947] stm32 INFO: Read protection: 0x0000
[13:41:25.950] stm32 INFO: Chip ID: 0x0413 - STM32F40xxx/41xxx
[13:41:25.950] main INFO: Connected
[13:41:25.958] main INFO: Writing memory at 0x08000000:6548
[13:41:25.958] stm32 INFO: Progress: 0%
[13:41:26.201] stm32 INFO: Progress: 11%
[13:41:26.429] stm32 INFO: Progress: 23%
[13:41:26.657] stm32 INFO: Progress: 35%
[13:41:26.895] stm32 INFO: Progress: 46%
[13:41:27.136] stm32 INFO: Progress: 58%
[13:41:27.371] stm32 INFO: Progress: 70%
[13:41:27.617] stm32 INFO: Progress: 82%
[13:41:27.908] stm32 INFO: Progress: 93%
[13:41:28.065] stm32 INFO: Progress: 100%
[13:41:28.065] main INFO: Successful
[13:41:28.065] main INFO: Writing memory at 0x08004000:16
[13:41:28.065] stm32 INFO: Progress: 0%
[13:41:28.074] stm32 INFO: Progress: 100%
[13:41:28.074] main INFO: Successful
[13:41:28.074] main INFO: Disconnecting target
[13:41:28.074] main INFO: Disconnected
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].