Comments (7)
@Jochen0x90h I think I answered before fully reading yourn question. :) Your answer is mostly in the packed structs. gs_device_config
sends the capabilities of the device to the host, and the host keeps GS_MAX_RX_URBS
(30) bulk IN URB requests outstanding at a time.
I'm planning on submitting a proposal to extend this driver to support CAN FD and also to make it more efficient for CAN and CAN FD. This discussion will take place on LKML and probably linux-usb and linux-can. When i finally get around to it, I'll announce it here.
from candlelight_fw.
@Jochen0x90h I think the Kernel module source can be a starting point:
https://github.com/torvalds/linux/blob/master/drivers/net/can/usb/gs_usb.c
from candlelight_fw.
@Jochen0x90h Yes, I'm afraid that's about it. In general, there is can.rst / can.txt in the kernel Documentation, but that's for the higher-level access to CAN devices in Linux.
To better understand gs_usb.c, you'll need to read it and also understand the various sub-systems it's implementing devices in. I also know that Ethan has some info on OSX here. Sorry I don't have much more for you as I don't use Mac.
from candlelight_fw.
@daniel-santos Thanks. I have to start experimenting with it, but if you know how to fill out gs_device_bittiming to get 500kHz (for OBDII port) this would be a good starting point
from candlelight_fw.
I'm now able to initialize the device and set the bit timing, but simply sending and receiving frames doesn't do the trick yet.
Here's my code, see line 393: https://github.com/Jochen0x90h/candlelight-libusb/blob/master/src/main.cpp
I receive garbage in the frame but I would expect that I receive nothing if nothing is connected to the can bus. When I connect it to the OBD-II Port of a car then I still receive garbage. Is there anything I miss?
from candlelight_fw.
@vondraussen Now I got it to work. These problems I still have with a CANable 0.2 device:
-
In loopback mode, I get two responses with different timestamps while I would expect only one
-
Sometimes I can read some or many frames after disable/enable and before a frame was written. Termination is set. this seems to be an issue with the buffer management, maybe the queues are not cleared when the can gets disabled.
-
Sometimes I don't get a reply to a real OBD-II request to a car on the first try, but on the second.
from candlelight_fw.
Closing this due to inactivity, and because there's not much documentation beyond the linux driver sourcecode. Feel free to reopen
from candlelight_fw.
Related Issues (20)
- RFC: whitespace HOT 2
- Handling GS_USB_BREQ_SET_TERMINATION and GS_USB_BREQ_GET_TERMINATION requests HOT 2
- github actions : `The set-output command is deprecated and will be disabled soon.`
- Adding support for the STM32G0 HOT 17
- RFC: cmake-presets to select included toolchain file by default ?
- tweak `atexit` to get rid of malloc HOT 2
- RFC : empty fifos + hardware mailboxes when re-enabling CAN ? HOT 6
- startup.c is broken - hardfault with large BSS HOT 8
- While loops in USB ISR HOT 7
- Feature: add support for `GS_CAN_FEATURE_GET_STATE` and `GS_CAN_FEATURE_BERR_REPORTING` HOT 5
- build warning: "_close is not implemented and will always fail" HOT 2
- Canable device hangs after desktop application crash (= stop without disonnecting) HOT 25
- cansequence tool shows wrong telegram order HOT 19
- Clear internal data structures holding unsent frames HOT 1
- Openmoko firmware upgrade , no jumper to enter DFU mode or button HOT 21
- About candlelight and Cangaroo HOT 2
- version for stm32F042C4xx? HOT 7
- No Can Frames recieved after device reset without a power cycle. candleLight Firmware. HOT 7
- CandleLight FD at 8 Mbps HOT 3
- CPU_FAMILY STM32G0B1XK vs. CPU_FAMILY STM32G0B1XE (not comprehensible for rookies) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from candlelight_fw.