problems in generating c code for raspberry pi: availableWebcam.c:(.text+0x1fc): `main_terminate' not define
1 view (last 30 days)
Show older comments
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 Comments
Denis Gurchenkov
on 23 Jul 2020
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?
Answers (1)
Reeno Joseph
on 30 Jul 2020
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')
See Also
Categories
Find more on Raspberry Pi Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!