MATLAB Answers

S-Function wrapper not found when building in External mode

3 views (last 30 days)
Felix Kong
Felix Kong on 19 Jan 2017
Answered: Felix Kong on 19 Jan 2017
Hi,
I'm trying to run a Simulink file in external mode on a Beaglebone Black. In my Simulink file is an S-Function Builder block in which I've written, which compiles just fine by itself. However, when I hit "Build" for the whole .slx file, it fails to generate all binary outputs. The tail end of the diagnostic viewer output is:
"### Creating standalone executable "../blacklinktest.elf" ..."
C:/MATLAB/SUPPOR~1/R2015b/LINARO~1.8/bin/arm-linux-gnueabihf-g++ -lm -lrt -lpthread -ldl -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot="C:\MATLAB\SupportPackages\R2015b\beaglebone\toolbox\target\supportpackages\beaglebone\libc" -D_MW_ANALOG_INPUT_H_ -o ../blacklinktest.elf blacklinktest.c.o blacklinktest_data.c.o BBB_Driver_USRLED_wrapper.c.o myLTI_wrapper.pp.o linuxinitialize.c.o ert_main.c.o -lm -lm
blacklinktest.c.o: In function `blacklinktest_step':
blacklinktest.c:(.text+0x494): undefined reference to `myLTI_Outputs_wrapper'
blacklinktest.c.o: In function `blacklinktest_derivatives':
blacklinktest.c:(.text+0x5ca): undefined reference to `myLTI_Derivatives_wrapper'
collect2.exe: error: ld returned 1 exit status
gmake: *** [../blacklinktest.elf] Error 1
### Build procedure for model: 'blacklinktest' aborted due to an error.
"myLTI" is the name of my S-Function, and "blacklinktest.slx" is the name of my model. It seems like the S-Function wrappers are not being generated properly. Any suggestions for how I can fix this?
Edit: I have tried using another S-Function in my model, from the BLACKlink library available on MATLAB Central, and that works fine. However, my own S-Function Builder implementation doesn't work.

Answers (1)

Felix Kong
Felix Kong on 19 Jan 2017
Wrote another S-Function from scratch that does something similar, and that worked. Might be some error in my code for myLTI. Anyway, it works now.

Community Treasure Hunt

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

Start Hunting!

Translated by