- Install the Simulink Coder Add-on
- Go to the Model Configuration Parameters of your model and Select:
- Click Ok and open the Configuration Parameters again. The Code Generation tab should now appear.
- On the Code Generation tab type in the following:
- Now you can use the wiringPi library and the Pigpio library when they are installed on your pi.
S-Function Builder Raspberry Pi
3 次查看(过去 30 天)
显示 更早的评论
Good evening, I have a problem with the creation of an S-Function for my project with Raspberry Pi2 model B. Using an S-Function Builder to import the library wiringPi within my project. The compilation does not create errors, but when I load this project into problems arise tab.
_ _ _Error executing command "touch -c /home/pi/simulink/untitled1_ert_rtw/*.*;make -f untitled1.mk all -C /home/pi/simulink/untitled1_ert_rtw". Details:
STDERR: library_wrapper.c:16:50: fatal error: /home/pi/wiringPi/wiringPi/gertboard.h: No such file or directory #include ^ compilation terminated. make: * [library_wrapper.c.o] Error 1
STDOUT: make: Entering directory '/home/pi/simulink/untitled1_ert_rtw' gcc -c -MMD -MP -MF"untitled1.c.dep" -MT"untitled1.c.o" -O0 -DMODEL=untitled1 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=untitled1 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "untitled1.c.o" "untitled1.c" gcc -c -MMD -MP -MF"library_wrapper.c.dep" -MT"library_wrapper.c.o" -O0 -DMODEL=untitled1 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=untitled1 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "library_wrapper.c.o" "library_wrapper.c" untitled1.mk:431: recipe for target 'library_wrapper.c.o' failed make: Leaving directory '/home/pi/simulink/untitled1_ert_rtw'___
0 个评论
回答(2 个)
Gregor Röring
2019-4-6
I had the same problem with a Pi zero w and after a lot of try and error I found the solution.
1 个评论
Marc Uedelhofen
2019-4-6
Hi,
This is a model that has been configured according to the specifications. There is one S-function that uses wiringPi, and one that uses pigpio. The wiringPi library should have been installed on Matlab's Raspberry. It is possible that pigpio still has to be installed. Or the S-function can be commented out. After "Build" has been clicked, it should run on the target hardware.
Marc
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Run on Target Hardware 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!