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!