MATLAB Answers

Coder.ceval on Raspberry Pi: Undefined reference error

1 view (last 30 days)
Dennis on 6 Jan 2016
Commented: Murat Belge on 6 Jan 2016
I have a C function "callit_ss.c" called from a Matlab function block with coder.ceval. It runs successfull on normal Simulink mode and also on the Arduino target.
On Raspberry Pi target, make gives the following error:
Error executing SSH command: make:
undefined reference to `callit_ss' collect2: ld returned 1 exit status
The .h and .c files are referenced in the Simulink Settings > Custom Code > Header File
and in ...>Include list of additional: Source files
Do I assume correctly that when the Simulink model is tried to be compiled on the Raspberry Pi, the references got lost somehow? what do I need to set up to be able to run that C code on the Raspberry Pi target?
Thanks, Dennis
  1 Comment
Murat Belge
Murat Belge on 6 Jan 2016
Any include files or sources added to the model using Custom Code are normally packaged and transferred to the Raspberry Pi for compilation. There are several examples that use exactly this approach to create device drivers in "Device Drivers" MATLAB File Exchange submission. There is a section dedicated to MATLAB function block and coder.ceval. You can find several examples for Raspberry Pi.
Also, make sure that when specifying files in the Custom Code pane of the Model Configuration Parameters, specify the absolute path for the files.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!