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

19 ビュー (過去 30 日間)
Florian Bosson
Florian Bosson 2021 年 7 月 15 日
コメント済み: Jonathan Nicols 2022 年 8 月 30 日
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.

採用された回答

Adit Calambur
Adit Calambur 2021 年 7 月 21 日
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.
  2 件のコメント
Florian Bosson
Florian Bosson 2021 年 7 月 22 日
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.
Jonathan Nicols
Jonathan Nicols 2022 年 8 月 30 日
Hi Florian, How did your Redis CAN project end up? I have a very similar project and want to introduce BeagleBone Blue into the architecture. Would be nice to collaborate on this.

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by