problems in generating c code for raspberry pi: availableWebcam.c:(.text+0x1fc): `main_terminate' not define
조회 수: 1 (최근 30일)
이전 댓글 표시
here i use the matlab coder for generting code for raspberry pi by using the code below:
cfg = coder.config('exe');
host = raspi('xxx.xxx.xx.xx','pi', 'pi');
cfg.TargetLang = 'C++';
dlcfg = coder.DeepLearningConfig('arm-compute');
dlcfg.ArmArchitecture = 'armv7';
dlcfg.ArmComputeVersion = '19.02';
cfg.DeepLearningConfig = dlcfg;
cfg.Hardware = coder.hardware('Raspberry Pi');
cfg.Hardware.BuildDir = '/home/pi/matlab_arm_codegen/';
%cfg.VerificationMode = 'PIL';
%cfg.GenerateExampleMain = 'GenerateCodeOnly';
cfg.CustomInclude = fullfile('codegen','exe','yolov2_detect_arm','examples');
cfg.CustomSource = fullfile('codegen','main.cpp');
codegen('-config',cfg,'yolov2_detect_arm','-report');
but when i want to compile the exe file this error occured and I cannot find out a solution for that, can anyone help?
availableWebcam.c.o: 関数 `getCameraAddrIndex' 内:
availableWebcam.c:(.text+0x1fc): `main_terminate' に対する定義されていない参照です
availableWebcam.c.o: 関数 `validateResolution' 内:
availableWebcam.c:(.text+0x30c): `main_terminate' に対する定義されていない参照です
availableWebcam.c.o: 関数 `getCameraList' 内:
availableWebcam.c:(.text+0x74c): `main_terminate' に対する定義されていない参照です
collect2: error: ld returned 1 exit status
make: *** [/home/pi/matlab_arm_codegen//MATLAB_ws/R2020a/C/WORK/matlab/yolov2arm/yolov2_detect_arm.elf] エラー 1
댓글 수: 2
Denis Gurchenkov
2020년 7월 23일
Hi,
Can you please attach yolov2_detect_arm.m and other files that are required to reproduce this? Also, is main.cpp generated by codegen is it copied by you from elsewhere?
답변 (1개)
Reeno Joseph
2020년 7월 30일
Hi Liheng,
We have a limitation with codegen for Raspi peripherals -- Need to add some explicit init/terminate calls.
So if you are using any raspi peripherals within the MATLAB function, Please use the 'Run on Hardware' workflow. This is a simplified version of 'codegen' command with target specific inti/terminate calls. Please have a look at the featured example as well.
For your particular example, please try these commands:
board = targetHardware('Raspberry Pi')
board.CoderConfig.TargetLang = 'C++'
dlcfg = coder.DeepLearningConfig('arm-compute');
dlcfg.ArmArchitecture = 'armv7';
board.CoderConfig.DeepLearningConfig = dlcfg
deploy(board,'yolov2_detect_arm')
참고 항목
카테고리
Help Center 및 File Exchange에서 Raspberry Pi Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!