jgressmann / supercan Goto Github PK
View Code? Open in Web Editor NEWThis is project SuperCAN. An open source USB to CAN-FD protocol.
License: MIT License
This is project SuperCAN. An open source USB to CAN-FD protocol.
License: MIT License
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
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
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?
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.
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!
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'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.