From 259326afb259f3294501be679b079aefbaf663fb Mon Sep 17 00:00:00 2001
From: Pavel Pisa
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 Simulation → Model 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 ++