-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CAN bus support #355
Comments
Also having the greatFET function as a linux socketCAN adapter would be great for using pre-existing tools. https://github.com/torvalds/linux/blob/master/Documentation/networking/can.rst |
I looked into this some months back, and made a very simple transceiver neighbor - https://github.com/tarikku/canna-greatfet-neighbor, but had not done much on the driver side. My plan was to develop an open source driver and not use the existing ones. Back then I didn't get too far due to too many projects. There is a silicon error in the LPC used in the GreatFET which effectively makes it impossible to effectively use/control I2C and CAN simultaneously. I was planning on adding an I2C IO expander to the Canna in order to make it more neighborly. This should be OK even with the silicon error, due to the very simple CAN transceivers I chose. The state machine is very simple and I wasn't considering wake-up on CAN so the idea would be to grab I2C to set the transceiver (s) up, release I2C and from then on use CAN only. It would be great to pool time and work this together if you or anyone else would like. I could probably also lend a hand if you choose to go in another direction too. |
I believe that silicon error you're having is part of the specifications "Use of C_CAN controller
|
Right, using a C_CANx actively makes it impossible to use another peripheral on the same bus bridge. Canna rev1 uses GPIO pins to control each TJA1042T-3 transceiver, which has a standby mode that you can switch to by asserting a HIGH on the STB pin. The Wikipedia CAN bus article is a good intro to CAN, with the illustration showing the three main parts of a typical CAN node: the MCU talking to a CAN controller (nowadays usually built-in to the MCU, as in the LPC43xx, for protocol control), and a CAN transceiver (for medium access). I built a Canna prototype but have not tested it through yet. If you are looking into making one, the Canna repository already has everything you need to have your own PCB made (I got mine from JLCPCB). |
Just a short note to say we'd be happy to assist with reviewing any PR's to add CAN bus support. |
Having CAN bus supported by the API would be nice for automotive/industrial use. I believe the LPC4330 has support for it with C_CAN0/C_CAN1. Is this on the roadmap anywhere? Has anyone played around with this before? I'm not super familiar with the greatfet firmware or really writing bare metal firmware in general so I have no clue how big of a project this is.
The text was updated successfully, but these errors were encountered: