Can't deploy the executable on Raspberry Pi and Matlab Coder doesn't generate the .elf file
Mostra commenti meno recenti
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 Commenti
Prasanth Sunkara
il 18 Ago 2021
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
il 18 Ago 2021
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
il 18 Ago 2021
Pietro Ventrella
il 18 Ago 2021
Walter Roberson
il 18 Ago 2021
I cannot read the entire error. Something about an error executing touch ?
Pietro Ventrella
il 6 Ott 2021
Walter Roberson
il 8 Ott 2021
Please just post it or attach it.
Pietro Ventrella
il 8 Ott 2021
David Fink
il 19 Ott 2021
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
il 19 Ott 2021
Risposte (1)
Walter Roberson
il 8 Ott 2021
0 voti
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 Commenti
Pietro Ventrella
il 9 Ott 2021
Modificato: Pietro Ventrella
il 9 Ott 2021
Walter Roberson
il 9 Ott 2021
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
il 9 Ott 2021
Walter Roberson
il 9 Ott 2021
/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
il 12 Ott 2021
Modificato: Pietro Ventrella
il 12 Ott 2021
Walter Roberson
il 12 Ott 2021
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
il 12 Ott 2021
Walter Roberson
il 12 Ott 2021
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.)
Categorie
Scopri di più su ARM Cortex-A Processors in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




