|
|
AD-Wandler mcp3008 mit Simulink lesen |
|
minime1988 |
Forum-Newbie
|
|
Beiträge: 2
|
|
|
|
Anmeldedatum: 24.01.17
|
|
|
|
Wohnort: ---
|
|
|
|
Version: ---
|
|
|
|
|
|
Verfasst am: 24.01.2017, 19:51
Titel: AD-Wandler mcp3008 mit Simulink lesen
|
|
|
|
|
Hallo zusammen,
ich hoffe hier kann mir jemand weiterhelfen, da ich aktuell ziemlich verzweifelt bin und nicht mehr weiter weiß.
Im muss im Rahmen eines Projektes eine Analogspannung auswerten.
Die verwendete Hardware:
Raspberry Pi 3
AD-Wandler 3008
Meine Internetsuche ist mittlerweile an ihre Grenzen gestoßen aber ich finde einfach keinen Weg das ganze zum laufen zu bringen.
der AD-Wandler ist wie in der Anleitung angeschlossen:
http://de.mathworks.com/help/suppor.....alog-input-using-spi.html
Nun wollte ich das ganze mit Hilfe dieser Driver-Blöcke zum laufen bringen:
http://de.mathworks.com/matlabcentr.....driver-blocks-adc-dac-pwm
wiringPi habe ich nach dieser Anleitung auf den Pi gespielt:
http://wiringpi.com/download-and-install/
Wenn ich jedoch all diese Schritte befolge bekomme ich immer eine Fehlermeldung, sobald ich auf "Deploy to Hardware" klicke.
Die Fehlermeldung ist folgende:
### Generating code into build folder: C:\Users\Valerio\Documents\MATLAB\AD_Wandler_test\rpi_driver_blocks_ert_rtw
### Invoking Target Language Compiler on rpi_driver_blocks.rtw
### Using System Target File: C:\Program Files\MATLAB\R2016b\rtw\c\ert\ert.tlc
### Loading TLC function libraries
......
### Initial pass through model to cache user defined code
.
### Caching model source code
..........................
### Writing header file rpi_driver_blocks.h
### Writing header file rpi_driver_blocks_types.h
.
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing source file rpi_driver_blocks.cpp
### Writing header file rpi_driver_blocks_private.h
### Writing source file rpi_driver_blocks_data.cpp
.
### Writing header file rtmodel.h
### Writing source file ert_main.cpp
### TLC code generation complete.
### Generating TLC interface API.
...
### Creating data type transition file rpi_driver_blocks_dt.h
### Evaluating PostCodeGenCommand specified in the model
### Using toolchain: GNU GCC Raspberry Pi v1.0 | gmake (64-bit Windows)
### 'C:\Users\Valerio\Documents\MATLAB\AD_Wandler_test\rpi_driver_blocks_ert_rtw\rpi_driver_blocks.mk' is up to date
### Building 'rpi_driver_blocks': make -f rpi_driver_blocks.mk all
### Build procedure for model: 'rpi_driver_blocks' aborted due to an error.
Error executing command "touch -c /home/pi/rpi_driver_blocks_ert_rtw/*.*;make -f rpi_driver_blocks.mk all -C /home/pi/rpi_driver_blocks_ert_rtw". Details:
STDERR: cc1: warning: command line option â-fpermissiveâ is valid for C++/ObjC++ but not for C
cc1: warning: command line option â-fpermissiveâ is valid for C++/ObjC++ but not for C
cc1: warning: command line option â-fpermissiveâ is valid for C++/ObjC++ but not for C
cc1: warning: command line option â-fpermissiveâ is valid for C++/ObjC++ but not for C
cc1: warning: command line option â-fpermissiveâ is valid for C++/ObjC++ but not for C
cc1: warning: command line option â-fpermissiveâ is valid for C++/ObjC++ but not for C
In file included from linuxinitialize.cpp:8:0:
linuxinitialize.h:4:0: warning: "_GNU_SOURCE" redefined
#define _GNU_SOURCE
^
<command-line>:0:0: note: this is the location of the previous definition
In file included from ert_main.cpp:27:0:
linuxinitialize.h:4:0: warning: "_GNU_SOURCE" redefined
#define _GNU_SOURCE
^
<command-line>:0:0: note: this is the location of the previous definition
sfcn_MCP3008_Out_wrapper.cpp.o: In function `sfcn_MCP3008_Out_Outputs_wrapper(unsigned short*, double const*, unsigned char const*, int)':
sfcn_MCP3008_Out_wrapper.cpp:(.text+0x24): undefined reference to `analogRead'
sfcn_MCP3008_Out_wrapper.cpp.o: In function `sfcn_MCP3008_Out_Update_wrapper(unsigned short*, double*, unsigned char const*, int)':
sfcn_MCP3008_Out_wrapper.cpp:(.text+0x58): undefined reference to `wiringPiSetup'
sfcn_MCP3008_Out_wrapper.cpp:(.text+0x64): undefined reference to `mcp3004Setup'
collect2: error: ld returned 1 exit status
make: *** [../rpi_driver_blocks.elf] Error 1
STDOUT: make: Entering directory '/home/pi/rpi_driver_blocks_ert_rtw'
g++ -c -MMD -MP -MF"rpi_driver_blocks.cpp.dep" -MT"rpi_driver_blocks.cpp.o" -O2 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "rpi_driver_blocks.cpp.o" "rpi_driver_blocks.cpp"
g++ -c -MMD -MP -MF"rpi_driver_blocks_data.cpp.dep" -MT"rpi_driver_blocks_data.cpp.o" -O2 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "rpi_driver_blocks_data.cpp.o" "rpi_driver_blocks_data.cpp"
gcc -c -MMD -MP -MF"ext_svr.c.dep" -MT"ext_svr.c.o" -O0 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "ext_svr.c.o" "ext_svr.c"
gcc -c -MMD -MP -MF"updown.c.dep" -MT"updown.c.o" -O0 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "updown.c.o" "updown.c"
gcc -c -MMD -MP -MF"ext_work.c.dep" -MT"ext_work.c.o" -O0 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "ext_work.c.o" "ext_work.c"
gcc -c -MMD -MP -MF"rtiostream_utils.c.dep" -MT"rtiostream_utils.c.o" -O0 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "rtiostream_utils.c.o" "rtiostream_utils.c"
g++ -c -MMD -MP -MF"sfcn_MCP3008_Out_wrapper.cpp.dep" -MT"sfcn_MCP3008_Out_wrapper.cpp.o" -O2 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "sfcn_MCP3008_Out_wrapper.cpp.o" "sfcn_MCP3008_Out_wrapper.cpp"
gcc -c -MMD -MP -MF"rtiostream_interface.c.dep" -MT"rtiostream_interface.c.o" -O0 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "rtiostream_interface.c.o" "rtiostream_interface.c"
gcc -c -MMD -MP -MF"rtiostream_tcpip.c.dep" -MT"rtiostream_tcpip.c.o" -O0 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "rtiostream_tcpip.c.o" "rtiostream_tcpip.c"
g++ -c -MMD -MP -MF"linuxinitialize.cpp.dep" -MT"linuxinitialize.cpp.o" -O2 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "linuxinitialize.cpp.o" "linuxinitialize.cpp"
g++ -c -MMD -MP -MF"ert_main.cpp.dep" -MT"ert_main.cpp.o" -O2 -fpermissive -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=rpi_driver_blocks -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "ert_main.cpp.o" "ert_main.cpp"
echo "### Creating standalone executable "../rpi_driver_blocks.elf" ..."
### Creating standalone executable ../rpi_driver_blocks.elf ...
g++ -lrt -lpthread -ldl -o ../rpi_driver_blocks.elf rpi_driver_blocks.cpp.o rpi_driver_blocks_data.cpp.o ext_svr.c.o updown.c.o ext_work.c.o rtiostream_utils.c.o sfcn_MCP3008_Out_wrapper.cpp.o rtiostream_interface.c.o rtiostream_tcpip.c.o linuxinitialize.cpp.o ert_main.cpp.o -lm -lm -lstdc++
rpi_driver_blocks.mk:346: recipe for target '../rpi_driver_blocks.elf' failed
make: Leaving directory '/home/pi/rpi_driver_blocks_ert_rtw'
Kann mir jemand weiter helfen, hat jemand mit so einem Vorhaben schon mal Erfahrungen gesammelt ? Oder gibt es eine andere Alternative Analogsignale mit Hilfe eines Rasperry Pi und Simulink auszuwerten ?
Ich bin für jede Hilfe sehr dankbar!
Grüße
|
|
|
|
|
m6vitek |
Gast
|
|
Beiträge: ---
|
|
|
|
Anmeldedatum: ---
|
|
|
|
Wohnort: ---
|
|
|
|
Version: ---
|
|
|
|
|
|
Verfasst am: 15.02.2017, 12:23
Titel: Linker Fehler
|
|
|
|
|
Hallo zusammen,
ich habe zum Teil das gleiche Problem wie der Vorredner. Ich habe versucht, mit dem S Function Builder ein einfaches C-Programm(Blink LED) von Raspberry Pi3 in Simulink zu integrieren, leider bekomme ich Fehler vom Linker. Ich habe schon das ganze Mathworks-Forum durchgelesen und alles Mögliche durchprobiert, jedoch ohne Erfolg.
In früheren Versionen konnte man mit "xmakefilesetup" die Linkereinstellungen für "gmake_remotebuild" ändern, in der 2016b Version finde ich diese Einstellungen nicht.
Habe schon Versucht unter Model Configuration Parameters -> Code Generation -> Build Configuration -> Specify den linkerflag -lbcm2835 für die verwendete Library zu setzen aber auch ohne Ergolg. Hier ist die Fehlermeldung, die ich immer wieder erhalte, sobald ich das Model auf der Zielhardware ausführe.
### Generating code into build folder: C:\Users\Viktor\Desktop\SUMU_TEST\testmodel_ert_rtw
### Invoking Target Language Compiler on testmodel.rtw
### Using System Target File: C:\Program Files\MATLAB\R2016b\rtw\c\ert\ert.tlc
### Loading TLC function libraries
......
### Initial pass through model to cache user defined code
.
### Caching model source code
..........................
### Writing header file testmodel.h
### Writing header file testmodel_types.h
.
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing source file testmodel.c
### Writing header file testmodel_private.h
### Writing source file testmodel_data.c
.
### Writing header file rtmodel.h
### Writing source file ert_main.c
### TLC code generation complete.
### Generating TLC interface API.
...
### Creating data type transition file testmodel_dt.h
### Evaluating PostCodeGenCommand specified in the model
### Using toolchain: GNU GCC Raspberry Pi v1.0 | gmake (64-bit Windows)
### Creating 'C:\Users\Viktor\Desktop\SUMU_TEST\testmodel_ert_rtw\testmodel.mk' ...
### Building 'testmodel': make -f testmodel.mk all
### Build procedure for model: 'testmodel' aborted due to an error.
Error executing command "touch -c /home/pi/simulink/testmodel_ert_rtw/*.*;make -f testmodel.mk all -C /home/pi/simulink/testmodel_ert_rtw". Details:
STDERR: simu_test_wrapper.c.o: In function `programSetup':
simu_test_wrapper.c.text+0x28): undefined reference to `bcm2835_init'
simu_test_wrapper.c.text+0x48): undefined reference to `bcm2835_gpio_fsel'
simu_test_wrapper.c.text+0x54): undefined reference to `bcm2835_gpio_fsel'
simu_test_wrapper.c.text+0x5c): undefined reference to `bcm2835_close'
simu_test_wrapper.c.o: In function `toggle':
simu_test_wrapper.c.text+0xa0): undefined reference to `bcm2835_gpio_write'
simu_test_wrapper.c.text+0xc0): undefined reference to `bcm2835_gpio_write'
collect2: error: ld returned 1 exit status
make: *** [../testmodel.elf] Error 1
STDOUT: make: Entering directory '/home/pi/simulink/testmodel_ert_rtw'
gcc -c -MMD -MP -MF"testmodel.c.dep" -MT"testmodel.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "testmodel.c.o" "testmodel.c"
gcc -c -MMD -MP -MF"testmodel_data.c.dep" -MT"testmodel_data.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "testmodel_data.c.o" "testmodel_data.c"
gcc -c -MMD -MP -MF"ext_svr.c.dep" -MT"ext_svr.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "ext_svr.c.o" "ext_svr.c"
gcc -c -MMD -MP -MF"updown.c.dep" -MT"updown.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "updown.c.o" "updown.c"
gcc -c -MMD -MP -MF"ext_work.c.dep" -MT"ext_work.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "ext_work.c.o" "ext_work.c"
gcc -c -MMD -MP -MF"rtiostream_utils.c.dep" -MT"rtiostream_utils.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "rtiostream_utils.c.o" "rtiostream_utils.c"
gcc -c -MMD -MP -MF"simu_test_wrapper.c.dep" -MT"simu_test_wrapper.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "simu_test_wrapper.c.o" "simu_test_wrapper.c"
gcc -c -MMD -MP -MF"linuxinitialize.c.dep" -MT"linuxinitialize.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "linuxinitialize.c.o" "linuxinitialize.c"
gcc -c -MMD -MP -MF"rtiostream_interface.c.dep" -MT"rtiostream_interface.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "rtiostream_interface.c.o" "rtiostream_interface.c"
gcc -c -MMD -MP -MF"rtiostream_tcpip.c.dep" -MT"rtiostream_tcpip.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "rtiostream_tcpip.c.o" "rtiostream_tcpip.c"
gcc -c -MMD -MP -MF"ert_main.c.dep" -MT"ert_main.c.o" -O0 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=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 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DRT -DSTACK_SIZE=64 -DMODEL=testmodel -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -I./ -o "ert_main.c.o" "ert_main.c"
echo "### Creating standalone executable "../testmodel.elf" ..."
### Creating standalone executable ../testmodel.elf ...
gcc -lrt -lpthread -ldl -lbcm2835 -o ../testmodel.elf testmodel.c.o testmodel_data.c.o ext_svr.c.o updown.c.o ext_work.c.o rtiostream_utils.c.o simu_test_wrapper.c.o linuxinitialize.c.o rtiostream_interface.c.o rtiostream_tcpip.c.o ert_main.c.o -lm -lm -lstdc++
testmodel.mk:353: recipe for target '../testmodel.elf' failed
make: Leaving directory '/home/pi/simulink/testmodel_ert_rtw'
Falls jemand in der Lage ist, das Problem zu erkennen, bitte um eine Rückmeldung.
|
|
|
|
|
Einstellungen und Berechtigungen
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
Impressum
| Nutzungsbedingungen
| Datenschutz
| FAQ
| RSS
Hosted by:
Copyright © 2007 - 2024
goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.
|
|