From 259326afb259f3294501be679b079aefbaf663fb Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Wed, 15 Oct 2014 20:24:38 +0200 Subject: [PATCH] Little more information about CAN blocks use with ERT Linux target. Signed-off-by: Pavel Pisa --- can_bus/index.html | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/can_bus/index.html b/can_bus/index.html index 0fa76b9..e399efa 100644 --- a/can_bus/index.html +++ b/can_bus/index.html @@ -51,6 +51,7 @@ iface can0 can static The later setup works automatic even with CAN-USB converter hotplug.

+

The projects includes blocks library socketcan_lib.slx, simple example of provided blocks use cantransmit_ert.slx and more @@ -66,6 +67,42 @@ is provided as well. The CAN-USB converter from 8devices has been used in this case.

+ +

+Download/clone ERT Linux target +and Linux CAN bus toolbox repositories. The example expects the toolbox +are placed into user local ~/matlab/toolbox directory. +Setup Matlab path for thee projects. One option is to use ~/matlab/startup.m +file for this porpose: +

+
+function startup(AddRem)
+
+disp 'Executing local setup stript ~/matlab/startup.m'
+
+restoredefaultpath
+
+[matlab_startup_dir, matlab_startup_filename, matlab_startup_dir_ext] = fileparts(mfilename('fullpath'));
+
+addpath(fullfile(matlab_startup_dir, 'toolbox/ert_linux/ert_linux'));
+addpath(fullfile(matlab_startup_dir, 'toolbox/socketcan-simulink/blocks'));
+
+

+Use example model as base for the project or open SimulationModel Configuration Parameters +dialog and select System target file to ert_linux.tlc in Code Genration section. +Check Make command. It should be something like: +

+
+make_rtw OPT_OPTS="-O2 -ggdb -Wall -D_BSD_SOURCE"
+
+

+Use proper CC variable definition in case of cross compilation to some other target. +See next example for Raspberry Pi: +

+
+make_rtw OPT_OPTS="-O2 -ggdb -Wall -D_BSD_SOURCE" CC=arm-rpi-linux-gnueabihf-gcc
+
+
Linux CAN bus toolbox repository
-- 2.39.2