MATLAB Answers

How to use the CAN bus on the beaglebone blue with Simulink ?

10 views (last 30 days)
Hi everyone,
I would like to connect a beaglebone blue on a CAN bus and program it threw Simulink (with Simulink Coder). I use the addon "Simulink Coder Support Package for BeagleBone Blue Hardware", but there is no CAN block available as with Arduino or Raspberry pi Simulink's addons.
According to the BBBlue technical documentation, the card only include the tranceiver, and need to be program to generate CAN frames.
I noted that the CAN transceiver is connected to 2 UART0 pins, and the BBBlue Addon got SCI blocks (for UART).
These are my questions :
  • Did I miss something that could allow me to use the CAN port with the BBblue library ?
  • Did I miss an addon like "Vehicle Network Toolbox" that could generate CAN frame that could be converted to an electric signal on E18 and E17 pins ?
  • At least, could I control a MCP2515 thew the SPI port ? But which addons use to control it ? Mainly for initialise it ?
About my programming skills, I'm more a fan of arduino code than embeded C code. And I don't feel to have the skills to write on my own a CAN interface block for the BBBlue.
Thank you very much for your reply or the time spend to read my post.

Accepted Answer

Adit Calambur
Adit Calambur on 21 Jul 2021
Hi Florian,
To summarise your query, you are trying to interface a BeagleBoneBlue board through a CAN-bus by using Simulink Coder and are enquiring about the specifics covered in the Support package for BBBlue.
  1. Upon further reading on CAN bus setup with BBBlue boards, I found this site that shows the steps to be followed to set up CAN framework on a BBBlue board. See CANBus BBBlue.
  2. The Vehicle Network Toolbox includes blocks with options to configure CAN messages and objects. CAN frames must be configured for your bus setup. The Vehicle Network Toolbox includes blocks to set these parameters according to your requirements.
  3. You can use the Arduino MKR CAN shield instead of the MCP2515. They both use SPI communication. For more information, see MATLAB Answers MCP2515.
  1 Comment
Florian Bosson
Florian Bosson on 22 Jul 2021
Thank you for your answer.
So there are any solutions to deploy quickly a BeagleBone Blue CAN network.
For those who read this post, I'am working on a solution that may work, based on a Redis cache updated with a C coded subprogram that update each values reading the CAN network. So on Simulink I got two C fonctions that read and set values on the Redis cache.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by