S-Function Builder Raspberry Pi

조회 수: 11 (최근 30일)
Mirko
Mirko 2016년 11월 8일
댓글: Marc Uedelhofen 2019년 4월 6일
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'___

답변 (2개)

Gregor Röring
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. Install the Simulink Coder Add-on
  2. Go to the Model Configuration Parameters of your model and Select:Unbenannt.png
  3. Click Ok and open the Configuration Parameters again. The Code Generation tab should now appear.
  4. On the Code Generation tab type in the following:Unbenannt2.PNG
  5. Now you can use the wiringPi library and the Pigpio library when they are installed on your pi.
  댓글 수: 1
Marc Uedelhofen
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

댓글을 달려면 로그인하십시오.


Mirko
Mirko 2016년 11월 8일
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: In file included from library_wrapper.c:30:0: /home/pi/wiringPi/wiringPi/softPwm.c:36:0: warning: "MAX_PINS" redefined #define MAX_PINS 1024 ^ In file included from library_wrapper.c:19:0: /home/pi/wiringPi/wiringPi/softTone.c:35:0: note: this is the location of the previous definition #define MAX_PINS 64 ^ In file included from library_wrapper.c:30:0: /home/pi/wiringPi/wiringPi/softPwm.c:56:27: error: conflicting types for ‘threads’ static volatile pthread_t threads [MAX_PINS] ; ^ In file included from library_wrapper.c:19:0: /home/pi/wiringPi/wiringPi/softTone.c:40:18: note: previous declaration of ‘threads’ was here static pthread_t threads [MAX_PINS] ; ^ In file included from library_wrapper.c:30:0: /home/pi/wiringPi/wiringPi/softPwm.c:57:21: error: conflicting type qualifiers for ‘newPin’ static volatile int newPin = -1 ; ^ In file included from library_wrapper.c:19:0: /home/pi/wiringPi/wiringPi/softTone.c:42:12: note: previous definition of ‘newPin’ was here static int newPin = -1 ; ^ 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'
  댓글 수: 2
Iselgrey
Iselgrey 2017년 3월 2일
편집: Iselgrey 2017년 3월 2일
Hi, I'm currently having exactly the same problem. Have you solved it already by any chance?
Manuel
Manuel 2018년 9월 26일
Hola Alguien a podido resolver el problema

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Run on Target Hardware에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by