5.0
5.0 | 4 ratings Rate this file 43 Downloads (last 30 days) File Size: 17.8 KB File ID: #41491
image thumbnail

Raspberry Pi Driver Block SFunction

by

 

25 Apr 2013 (Updated )

Simple Digital Out SFunction example block showing how to use the WiringPi library

| Watch this File

File Information
Description

An example SFunction block for Raspberry Pi showing basic usage of the WiringPi library
The latest version of this file and others can be found at our Raspberry Pi downloads page:

http://minseg.webs.com/downloads

A complete Arduino library and curriculum is available here:
http://minseg.com/pages/downloads

coming soon:
- PWM
- Quadrature Encoder
- MPU6050

and others!

Acknowledgements

Device Drivers inspired this file.

Required Products Simulink
MATLAB
MATLAB release MATLAB 8.1 (R2013a)
Other requirements Raspberry Pi targetinstaller package
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
16 Feb 2015 chfakht chfakht

Hello ,
i have this error when trying to upload an example to the raspberry pi model b+

The call to realtime_make_rtw_hook, during the after_make hook generated the following error:
Error executing SSH command: make: Entering directory '/home/pi/MinSegMega_Demo_V2_rtt'
"gcc" -I"./" -O3 -D"MODEL=MinSegMega_Demo_V2" -D"NUMST=1" -D"NCSTATES=0" -D"HAVESTDIO=" -D"ON_TARGET_WAIT_FOR_START=1" -D"ONESTEPFCN=0" -D"EXT_MODE=1" -D"TERMFCN=1" -D"MAT_FILE=0" -D"MULTI_INSTANCE_CODE=0" -D"INTEGER_CODE=0" -D"MT=0" -D"CLASSIC_INTERFACE=0" -D"TID01EQ=0" -D"_USE_TARGET_UDP_=" -D"_RUNONTARGETHARDWARE_BUILD_=" -D"EXIT_FAILURE=1" -D"EXTMODE_DISABLETESTING=" -c ./linuxUDP.c ./MinSegMega_Demo_V2.c ./ert_main.c ./ext_svr.c ./ext_work.c ./rtiostream_interface.c ./updown.c ./rtiostream_tcpip.c ./rtiostream_utils.c
"gcc" ./linuxUDP.o ./MinSegMega_Demo_V2.o ./ert_main.o ./ext_svr.o ./ext_work.o ./rtiostream_interface.o ./updown.o ./rtiostream_tcpip.o ./rtiostream_utils.o -lm -ldl -lpthread -lrt -o ./MW/MinSegMega_Demo_V2
./MinSegMega_Demo_V2.o: In function `MinSegMega_Demo_V2_output':
MinSegMega_Demo_V2.c:(.text+0x4c): undefined reference to `sf_HMC5883L_MPU6050_Outputs_wrapper'
./MinSegMega_Demo_V2.o: In function `MinSegMega_Demo_V2_update':
MinSegMega_Demo_V2.c:(.text+0xa8): undefined reference to `sf_HMC5883L_MPU6050_Update_wrapper'
collect2: ld returned 1 exit status
_MinSegMega_Demo_V2.mk:161: recipe for target 'MW/MinSegMega_Demo_V2' failed
make: *** [MW/MinSegMega_Demo_V2] Error 1
make: Leaving directory '/home/pi/MinSegMega_Demo_V2_rtt'

The build process will terminate as a result.

Caused by:
Error executing SSH command: make: Entering directory '/home/pi/MinSegMega_Demo_V2_rtt'
"gcc" -I"./" -O3 -D"MODEL=MinSegMega_Demo_V2" -D"NUMST=1" -D"NCSTATES=0" -D"HAVESTDIO=" -D"ON_TARGET_WAIT_FOR_START=1" -D"ONESTEPFCN=0" -D"EXT_MODE=1" -D"TERMFCN=1" -D"MAT_FILE=0" -D"MULTI_INSTANCE_CODE=0" -D"INTEGER_CODE=0" -D"MT=0" -D"CLASSIC_INTERFACE=0" -D"TID01EQ=0" -D"_USE_TARGET_UDP_=" -D"_RUNONTARGETHARDWARE_BUILD_=" -D"EXIT_FAILURE=1" -D"EXTMODE_DISABLETESTING=" -c ./linuxUDP.c ./MinSegMega_Demo_V2.c ./ert_main.c ./ext_svr.c ./ext_work.c ./rtiostream_interface.c ./updown.c ./rtiostream_tcpip.c ./rtiostream_utils.c
"gcc" ./linuxUDP.o ./MinSegMega_Demo_V2.o ./ert_main.o ./ext_svr.o ./ext_work.o ./rtiostream_interface.o ./updown.o ./rtiostream_tcpip.o ./rtiostream_utils.o -lm -ldl -lpthread -lrt -o ./MW/MinSegMega_Demo_V2
./MinSegMega_Demo_V2.o: In function `MinSegMega_Demo_V2_output':
MinSegMega_Demo_V2.c:(.text+0x4c): undefined reference to `sf_HMC5883L_MPU6050_Outputs_wrapper'
./MinSegMega_Demo_V2.o: In function `MinSegMega_Demo_V2_update':
MinSegMega_Demo_V2.c:(.text+0xa8): undefined reference to `sf_HMC5883L_MPU6050_Update_wrapper'
collect2: ld returned 1 exit status
_MinSegMega_Demo_V2.mk:161: recipe for target 'MW/MinSegMega_Demo_V2' failed
make: *** [MW/MinSegMega_Demo_V2] Error 1
make: Leaving directory '/home/pi/MinSegMega_Demo_V2_rtt'

thanks

Comment only
10 Jan 2015 Daryl

Daryl (view profile)

Hi!

I have a problem when trying to run a sfunction which uses the wiringPi examples.

I can build the sfunction. After building i try to run the simulation on the external target. I then get a message with undefined references.

I noticed that the message also states:

"gcc" -I"./" -I"C:/Users/Daryl/SkyDrive/School/00_Matlab/Diy/raspberry_pi/home/pi/wiringPi/wiringPi"

Should this not be a direcory on the raspberry pi instead of a folfer on my windows computer?

Thanks in advance if one of you can help me!!

The complete error message is as follows:

The build process will terminate as a result.

Error executing SSH command: make: Entering directory '/home/pi/Digital_Out_SFunction_Example_rtt'
"gcc" -I"./" -I"C:/Users/Daryl/SkyDrive/School/00_Matlab/Diy/raspberry_pi/home/pi/wiringPi/wiringPi" -O3 -D"MODEL=Digital_Out_SFunction_Example" -D"NUMST=1" -D"NCSTATES=0" -D"HAVESTDIO=" -D"ON_TARGET_WAIT_FOR_START=1" -D"ONESTEPFCN=0" -D"EXT_MODE=1" -D"TERMFCN=1" -D"MAT_FILE=0" -D"MULTI_INSTANCE_CODE=0" -D"INTEGER_CODE=0" -D"MT=0" -D"CLASSIC_INTERFACE=0" -D"ALLOCATIONFCN=0" -D"TID01EQ=0" -D"_USE_TARGET_UDP_=" -D"_RUNONTARGETHARDWARE_BUILD_=" -D"EXIT_FAILURE=1" -D"EXTMODE_DISABLETESTING=" -c ./MW_gpio.c ./MW_pinMux.c ./linuxUDP.c ./ext_svr.c ./ext_work.c ./rtiostream_interface.c ./updown.c ./rtiostream_tcpip.c ./rtiostream_utils.c ./Digital_Out_SFunction_Example.c ./Digital_Out_SFunction_Example_data.c ./ert_main.c ./sfcn_Digital_Out_wrapper.c
"gcc" ./MW_gpio.o ./MW_pinMux.o ./linuxUDP.o ./ext_svr.o ./ext_work.o ./rtiostream_interface.o ./updown.o ./rtiostream_tcpip.o ./rtiostream_utils.o ./Digital_Out_SFunction_Example.o ./Digital_Out_SFunction_Example_data.o ./ert_main.o ./sfcn_Digital_Out_wrapper.o -lm -ldl -lpthread -lrt -o ./MW/Digital_Out_SFunction_Example
./sfcn_Digital_Out_wrapper.o: In function `pinMode':
sfcn_Digital_Out_wrapper.c:(.text+0xfd0): undefined reference to `softPwmStop'
sfcn_Digital_Out_wrapper.c:(.text+0xfd8): undefined reference to `softToneStop'
sfcn_Digital_Out_wrapper.c:(.text+0x12c0): undefined reference to `softPwmCreate'
sfcn_Digital_Out_wrapper.c:(.text+0x12cc): undefined reference to `softToneCreate'
collect2: ld returned 1 exit status
_Digital_Out_SFunction_Example.mk:122: recipe for target 'MW/Digital_Out_SFunction_Example' failed
make: *** [MW/Digital_Out_SFunction_Example] Error 1
make: Leaving directory '/home/pi/Digital_Out_SFunction_Example_rtt'

Comment only
31 Dec 2014 long Nguyen

This link may be helpful.

https://groups.google.com/forum/#!msg/beagleboard/fC-Bg_-Ia34/cvTeQvJ2MAwJ

Maybe problem because the compiler not link to matlab

Comment only
17 Nov 2014 Biao

Biao (view profile)

Hi, I have similar errors with Alexander. I have already installed latest wiringPi lib. So how do you deploy it and make it running well at raspberry pi?

Comment only
22 Feb 2014 Miguel

Miguel (view profile)

Hi I have the following problem.
All to Tools -> Run on Target Hardware -> RUN
I get:
Error in S-function 'Digital_Out_SFunction_Example / Toggle Pin Digital Output With SFunction': S-Function 'sfcn_Digital_Out' does not exist

They know how to fix it, possess the xls file and I can not install it on my Raspberry Pi. Thank you.

Comment only
06 Dec 2013 Liang Xuan

Hi Daniel, the problem solved when you replace the original wiringPi library in the raspberry with the latest version.

Comment only
06 Dec 2013 Liang Xuan  
14 Nov 2013 Daniel

Daniel (view profile)

Alexander, I keep getting a similar error. What did you do to get yours working?

Thank you,
Daniel

Comment only
22 May 2013 Alexander

Ive got it, ty.

22 May 2013 Alexander

hey, ive took this one by one and:

The call to realtime_make_rtw_hook, during the after_make hook generated the following error:
Error executing SSH command: make: Entering directory `/home/pi/Digital_Out_SFunction_Example_rtt'
"gcc" -I"./" -O3 -D"MODEL=Digital_Out_SFunction_Example" -D"NUMST=1" -D"NCSTATES=0" -D"HAVESTDIO=" -D"ONESTEPFCN=0" -D"TERMFCN=1" -D"MAT_FILE=0" -D"MULTI_INSTANCE_CODE=0" -D"INTEGER_CODE=0" -D"MT=0" -D"CLASSIC_INTERFACE=0" -D"TID01EQ=0" -D"_USE_TARGET_UDP_=" -D"_RUNONTARGETHARDWARE_BUILD_=" -c ./MW_gpio.c ./MW_pinMux.c ./linuxUDP.c ./Digital_Out_SFunction_Example.c ./Digital_Out_SFunction_Example_data.c ./ert_main.c ./sfcn_Digital_Out_wrapper.c
./sfcn_Digital_Out_wrapper.c:38:50: fatal error: /home/pi/wiringPi/wiringPi/gertboard.h: No such file or directory
compilation terminated.
make: *** [MW_gpio.o] Error 1
make: Leaving directory `/home/pi/Digital_Out_SFunction_Example_rtt'

The build process will terminate as a result.

Caused by:
Error executing SSH command: make: Entering directory `/home/pi/Digital_Out_SFunction_Example_rtt'
"gcc" -I"./" -O3 -D"MODEL=Digital_Out_SFunction_Example" -D"NUMST=1" -D"NCSTATES=0" -D"HAVESTDIO=" -D"ONESTEPFCN=0" -D"TERMFCN=1" -D"MAT_FILE=0" -D"MULTI_INSTANCE_CODE=0" -D"INTEGER_CODE=0" -D"MT=0" -D"CLASSIC_INTERFACE=0" -D"TID01EQ=0" -D"_USE_TARGET_UDP_=" -D"_RUNONTARGETHARDWARE_BUILD_=" -c ./MW_gpio.c ./MW_pinMux.c ./linuxUDP.c ./Digital_Out_SFunction_Example.c ./Digital_Out_SFunction_Example_data.c ./ert_main.c ./sfcn_Digital_Out_wrapper.c
./sfcn_Digital_Out_wrapper.c:38:50: fatal error: /home/pi/wiringPi/wiringPi/gertboard.h: No such file or directory
compilation terminated.
make: *** [MW_gpio.o] Error 1
make: Leaving directory `/home/pi/Digital_Out_SFunction_Example_rtt'

Some hints?

Regards,
Alex

29 Apr 2013 Murat Belge  
Updates
22 Aug 2014

updated links

Contact us