GithubHelp home page GithubHelp logo

marcinbor85 / can-prog Goto Github PK

View Code? Open in Web Editor NEW
75.0 7.0 19.0 61 KB

Command-line tool to flashing devices by CAN-BUS

License: MIT License

Python 100.00%
stm32 bootloade can bus canbus protocol socketcan

can-prog's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

can-prog's Issues

ImportError: No module named 'can'

Thanks for publishing this, it's gonna be useful for me!

However, a dependency seems to be missing from the pip module:

0 $ sudo pip3 install canprog
Collecting canprog
  Downloading canprog-0.1.0a2-py3-none-any.whl
Collecting intelhex (from canprog)
  Downloading intelhex-2.1-py2.py3-none-any.whl (46kB)
    100% |████████████████████████████████| 51kB 2.3MB/s
Installing collected packages: intelhex, canprog
Successfully installed canprog-0.1.0a2 intelhex-2.1
0 $ canprog -h
Traceback (most recent call last):
  File "/usr/local/bin/canprog", line 7, in <module>
    from canprog.main import main
  File "/usr/local/lib/python3.5/dist-packages/canprog/main.py", line 28, in <module>
    import can
ImportError: No module named 'can'
1 $

TypeError: super() takes at least 1 argument (0 given)

Attempting to use any example command lines, I consistently get the following output error.

File "/usr/local/bin/canprog", line 11, in <module> load_entry_point('canprog==0.2.1', 'console_scripts', 'canprog')() File "/usr/local/lib/python2.7/dist-packages/canprog/main.py", line 215, in main protocol = protocol_class(iface) File "/usr/local/lib/python2.7/dist-packages/canprog/protocols/stm32.py", line 122, in __init__ super().__init__(*args, **kwargs) TypeError: super() takes at least 1 argument (0 given)

timeout error when writing

I am experiencing an issue when writing to the device :

root@beaglebone:~/arm# ./canbin.sh
[21:09:03.614] main INFO: Connecting target
[21:09:03.621] stm32 INFO: Bootloader initialized
[21:09:03.642] stm32 INFO: Bootloader version: 2.0
[21:09:03.651] stm32 INFO: Read protection: 0x0000
[21:09:03.665] stm32 INFO: Chip ID: 0x0418 - STM32F105xx/107xx
[21:09:03.667] main INFO: Connected
[21:09:03.955] main INFO: Writing memory at 0x08000000:15940
[21:09:03.958] stm32 INFO: Progress: 0%
[21:09:05.181] main ERROR: Writing error: Receiving timeout

While reading doesn't have any issues :

root@beaglebone:~/arm# ./canread.sh
[21:16:03.951] main INFO: Connecting target
[21:16:03.959] stm32 INFO: Bootloader initialized
[21:16:03.981] stm32 INFO: Bootloader version: 2.0
[21:16:03.990] stm32 INFO: Read protection: 0x0000
[21:16:04.003] stm32 INFO: Chip ID: 0x0418 - STM32F105xx/107xx
[21:16:04.006] main INFO: Connected
[21:16:04.007] main INFO: Reading memory at 0x08000000:512
[21:16:04.009] stm32 INFO: Progress: 0%
[21:16:04.092] stm32 INFO: Progress: 50%
[21:16:04.137] stm32 INFO: Progress: 100%
[21:16:04.140] main INFO: Successful
[21:16:04.164] main INFO: Disconnecting target
[21:16:04.166] main INFO: Disconnected

Incompatibility with newer version of python-can

canprog seems to be incompatible with newer versions of python-can.

Using the latest version of python-can yields various runtime errors.

I resolved the issues by downgrading to python-can version 2.2.1.

pip install --force-reinstall -v python-can==2.2.1

Exit code 0 on failure

Thanks again for can-prog! I am scripting around can-prog right now and noticed that it exits with code zero even if the operation has failed:

# canprog -i socketcan -n can0 stm32 write fw.dump ; echo $?
[10:13:40.770] main INFO: Connecting target
[10:13:41.770] main ERROR: Connecting error: Receiving timeout
0

I'd suggest exiting with code 1 if the operation fails.

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.