Can't deploy the executable on Raspberry Pi and Matlab Coder doesn't generate the .elf file
古いコメントを表示
I've succesfully modified a deep learning matlab script to use it on a Raspberry Pi: i've done the code generation using Matlab Coder without any error and i've also tried the script directly on Matlab with the raspi connected to the pc. But if i try to deploy it as a standlone application on the raspi, i've got an error.

I've also tried to generate the code as an executable and even if the success message appears in the report saying that the output file is an .elf file, it doesn't appear in the folder or anywhere

I don't know if there is another possible way to deploy it on the raspi or to find out why the .elf file doesn't appear in the folder.
I post the options i used to generate the code and to deploy it, if they can be more useful.
Code Generation:

Deploy:

11 件のコメント
Prasanth Sunkara
2021 年 8 月 18 日
It is posible that the elf is running on the hw(raspberry pi). Try using the "Raspberry Pi resource monitor" app to confirm this.
Also, could you please share the error you saw on the MATLAB command window when the deployment failed. It would have some hints on why it failed.
-Prasanth
Walter Roberson
2021 年 8 月 18 日
The deploy error says that you cannot use an infinite loop. So put a finite but large loop instead. Or perhaps detect sufficiently dark image and terminate the loop, so you could break by covering the lens.
Pietro Ventrella
2021 年 8 月 18 日
Pietro Ventrella
2021 年 8 月 18 日
Walter Roberson
2021 年 8 月 18 日
I cannot read the entire error. Something about an error executing touch ?
Pietro Ventrella
2021 年 10 月 6 日
Walter Roberson
2021 年 10 月 8 日
Please just post it or attach it.
Pietro Ventrella
2021 年 10 月 8 日
David Fink
2021 年 10 月 19 日
Note on "I've also tried to generate the code as an executable and even if the success message appears in the report saying that the output file is an .elf file, it doesn't appear in the folder or anywhere":
The "Generate code only" checkbox on the code generation options page prevents the makefile from being invoked, so only the C++ sources are generated, and the C++ compiler is not invoked.
Based on later comments, it looks like you were able to invoke the makefile via the deployment workflow.
Pietro Ventrella
2021 年 10 月 19 日
回答 (1 件)
Walter Roberson
2021 年 10 月 8 日
0 投票
The error:
So opencv_core420.lib was not compiled with the same compiler.
You are compling with MinGW 7.1 or later, but you are using R2020b, which needs MinGW 6.3 https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/system-requirements-release-2020b-supported-compilers.pdf
8 件のコメント
Pietro Ventrella
2021 年 10 月 9 日
編集済み: Pietro Ventrella
2021 年 10 月 9 日
Walter Roberson
2021 年 10 月 9 日
The logs in https://www.mathworks.com/matlabcentral/answers/887539-can-t-deploy-the-executable-on-raspberry-pi-and-matlab-coder-doesn-t-generate-the-elf-file#comment_1773986 are clear they are R2020b and using GCC 7.1 or later . If it had been built with VS C++ then the logs would not be mentioning g++
Pietro Ventrella
2021 年 10 月 9 日
Walter Roberson
2021 年 10 月 9 日
/usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >’ changed in GCC 7.1
I guarantee that gcc 6.3 did not create that message.
The make process is picking up your newer gcc somehow.
Pietro Ventrella
2021 年 10 月 12 日
編集済み: Pietro Ventrella
2021 年 10 月 12 日
Walter Roberson
2021 年 10 月 12 日
Is it possible that the gcc version installed on the raspi is the problem?
No, the build process is entirely on the MATLAB host, and does not ask the raspi to compile.
Pietro Ventrella
2021 年 10 月 12 日
Walter Roberson
2021 年 10 月 12 日
Sorry, I do not have a Windows development system to test with.
(Microsoft considers me a commercial developer when I am volunteering to help other people, and the commercial licenses I would need are several thousand dollars per year.)
カテゴリ
ヘルプ センター および File Exchange で ARM Cortex-A Processors についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




