GithubHelp home page GithubHelp logo

jgressmann / supercan Goto Github PK

View Code? Open in Web Editor NEW
67.0 9.0 9.0 1.06 MB

This is project SuperCAN. An open source USB to CAN-FD protocol.

License: MIT License

C 38.07% C++ 41.24% QMake 0.07% Shell 16.14% Python 0.63% CMake 0.38% NSIS 2.70% Batchfile 0.77%
can-fd usb can-bus dfu bootloader teensy40 firmware teensy41 feather-m4-can-express cortex-m4

supercan's Introduction

SuperCAN

License [Build status

What is this?

This is project SuperCAN. An open source USB to CAN-FD protocol. SuperCAN works with these devices to form an USB to CAN-FD interface.

Supported Devices

Have a look here.

Supported Operating Systems

SuperCAN supports Windows 10 and Linux.

Apps

Windows

NOTE: Kindly ensure you have the device driver package installed on your system. Ensure you have copied the plugin from the Windows archive into the plugin folder of CANdevStudio.

Linux

NOTE: Kindly ensure you have the device driver built and loaded into the kernel. See below.

Windows API & demo app

Build the Visual Studio solution in the Windows folder. I use Visual Studio Community 2019 which is available free of charge for non-commercial products (as of this writing).

The solution contains code for a demo application that sends and dumps CAN traffic.

Linux SocketCAN driver

To build the Linux kernel module, please follow these instructions.

License

SuperCAN is available under the MIT license. SuperCAN uses FreeRTOS and TinyUSB which are both available under the same license.

The Linux driver is available under GPLv2 or MIT.

supercan's People

Contributors

jgressmann 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

supercan's Issues

Flashing a device that only has a bootloader fails.

I built a new interface with an ATSAME51J18A-AU and flashed only the bootloader by debugger.
Using dfu-util 0.9 under windows with this command line:
dfu-util -d 1d50:5035,:5036 -R -D supercan.dfu

the result is:
Opening DFU capable USB device...
ID 1d50:5036
Run-time device DFU version 0101
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: error get_status

When I also flash the firmware by debugger though flashing by USB works:
Opening DFU capable USB device...
ID 1d50:5035
Run-time device DFU version 0101
Claiming USB DFU Runtime Interface...
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
error detaching
Resetting USB...
Opening DFU USB Device...
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0101
Device returned transfer size 512
Copying data from PC to DFU device
Download [=========================] 100% 27448 bytes
Download done.
state(7) = dfuMANIFEST, status(0) = No error condition is present
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
can't detach
Resetting USB to switch back to runtime mode

Support for CANBed M4?

Have been following for a while and just noticed SEEED is selling these: https://www.seeedstudio.com/Canbed-M4-p-4782.html

I suspect they could work with this without too much effort given they are SAME5 based. Any chance support could be added?

Happy to try and help with this but not entirely sure where to start. Looks like maybe the board support for tinyusb? Thanks!

Question about Portable Threads, circa 2006

Hello Jean,

I have a question about some code of yours that is from your Potsdam university days, Portable Threads.
Sadly it appears that the majority of the code is lost to time (even the Wayback Machine / Internet Archive does not have a complete copy of the code).
My question is about the initial license for the code: The bits of code I have found show the GNU General Public License v2 or later, and then around 2006-ish you move the license to the BSD 3-clause. Is this correct?

Could I ask you if you still have a copy, would it be possible to add it to Github?
Thank you!

Wayback Links:
https://web.archive.org/web/20100109133636/http://www.0x42.de/
https://web.archive.org/web/20090426042240/http://fara.cs.uni-potsdam.de:80/~jsg/nucleus
https://web.archive.org/web/*/http://fara.cs.uni-potsdam.de/~jsg/portablethreads/html/*
https://web.archive.org/web/20090511023841/http://fara.cs.uni-potsdam.de:80/~jsg/portablethreads/html/thread_8h-source.html

D5035-01 XTAL SuperCAN Windows7 USB Driver?

Hi,

I successfully managed to compile SuperDFU and SuperCAN for CANBed M4 bought from https://docs.longan-labs.cc/1030013/

I flashed SuperDFU by J-Link and after that I used dfu-util to upload SuperCAN.dfu.

The problem is that I couldn't find USB drivers for SuperDFU and for D5035-01 XTAL SuperCAN USB devices.

I used zadig-2.7.exe to install drivers for SuperDFU and it works because I can upload supercan.dfu to the Board using dfu-util.

After that my Board looks like D5035-01 XTAL SuperCAN (b2a90602) in Device Manager of Windows and has exclamation sign that means that there is a problem with driver for it.

I used zadig-2.7.exe to solve this problem but I think it is wrong.

I compiled supercan_app64.exe(demo App from your Windows folder) and it couldn't find any SuperCAN device.

supercan_app64.exe tries to find device by GUID {0xf4ef82e0, 0xdc07, 0x4f21, 0x86, 0x60, 0xae, 0x50, 0xcb, 0x31, 0x49, 0xc9} but it is different from a GUID of my Board in Device Manager.

I tried to change GUID in supercan_app64.exe to that one from GUID of my Board in Device Manager with no result.

So I think the problem is in drivers for D5035-01 XTAL SuperCAN.

Can you help me to find these drivers please?

Please adapt the bootloader to work with different flash-sizes of the ATSAME51 family.

The page size across all E5x/D5x is 512 byte.
But the page size is also available in the NVMCTRL register PARAM as PSZ[2:0].
This supposedly has a value of 0x6 across all members of the family which means 512 byte.
And I just check with the debugger, both the E51J19A and the E51J18A have a 6 in these bits.

Regarding the total flash size, NVMCTRL register PARAM has NVMP[15:0]
which is the amount of pages.
And correctly so the E51J18A has a value of 0x200 in these bits and the E51J19A has a value of 0x400.
So the E51J20A should show 0x800.

Module Build issue on Ubuntu 20.04

Hey! Thanks for making this. It's very cool. I am running into an issue with compiling the module. Here's the make.log file with the error. Any ideas?


ubuntu@ubuntu-Latitude-E7470:~/supercan$ cat /var/lib/dkms/supercan_usb/0.2.5/build/make.log 
DKMS make.log for supercan_usb-0.2.5 for kernel 5.13.0-28-generic (x86_64)
Tue 08 Feb 2022 09:30:24 AM EST
make: Entering directory '/usr/src/linux-headers-5.13.0-28-generic'
  CC [M]  /var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.o
/var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c: In function ‘sc_usb_netdev_close’:
/var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c:403:3: error: too few arguments to function ‘can_free_echo_skb’
  403 |   can_free_echo_skb(netdev, i);
      |   ^~~~~~~~~~~~~~~~~
In file included from ./include/linux/can/dev.h:23,
                 from /var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c:11:
./include/linux/can/skb.h:26:6: note: declared here
   26 | void can_free_echo_skb(struct net_device *dev, unsigned int idx,
      |      ^~~~~~~~~~~~~~~~~
/var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c: In function ‘sc_usb_process_can_txr’:
/var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c:765:3: error: too few arguments to function ‘can_free_echo_skb’
  765 |   can_free_echo_skb(netdev, echo_skb_index);
      |   ^~~~~~~~~~~~~~~~~
In file included from ./include/linux/can/dev.h:23,
                 from /var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c:11:
./include/linux/can/skb.h:26:6: note: declared here
   26 | void can_free_echo_skb(struct net_device *dev, unsigned int idx,
      |      ^~~~~~~~~~~~~~~~~
/var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c:779:3: error: too few arguments to function ‘can_get_echo_skb’
  779 |   can_get_echo_skb(netdev, echo_skb_index);
      |   ^~~~~~~~~~~~~~~~
In file included from ./include/linux/can/dev.h:23,
                 from /var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c:11:
./include/linux/can/skb.h:24:14: note: declared here
   24 | unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx,
      |              ^~~~~~~~~~~~~~~~
/var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c: In function ‘sc_usb_netdev_tx_batch_unsafe’:
/var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c:1234:4: error: too few arguments to function ‘can_free_echo_skb’
 1234 |    can_free_echo_skb(netdev, echo_skb_index);
      |    ^~~~~~~~~~~~~~~~~
In file included from ./include/linux/can/dev.h:23,
                 from /var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c:11:
./include/linux/can/skb.h:26:6: note: declared here
   26 | void can_free_echo_skb(struct net_device *dev, unsigned int idx,
      |      ^~~~~~~~~~~~~~~~~
/var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c: In function ‘sc_usb_netdev_start_xmit’:
/var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c:1334:3: error: too few arguments to function ‘can_put_echo_skb’
 1334 |   can_put_echo_skb(skb, netdev, echo_skb_index);
      |   ^~~~~~~~~~~~~~~~
In file included from ./include/linux/can/dev.h:23,
                 from /var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.c:11:
./include/linux/can/skb.h:20:5: note: declared here
   20 | int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
      |     ^~~~~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.build:281: /var/lib/dkms/supercan_usb/0.2.5/build/supercan_usb.o] Error 1
make: *** [Makefile:1879: /var/lib/dkms/supercan_usb/0.2.5/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.13.0-28-generic'

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.