Cannot build Arduino slx (Code generation information file does not exist)

3 vues (au cours des 30 derniers jours)
Dimas Abreu Archanjo Dutra
Whenever I try to build any Simulink model for an Arduino target, I get the error Code generation information file does not exist. I am using Ubuntu Linux 22.10 and have permission to write to the Serial port. The hardware test of the Arduino support package works properly. These same models and procedures work on a different machine, so I'm not sure what is causing the error. I installed gcc-10 and gfortran-10.
I tried changing the path like suggeted in the answers for https://www.mathworks.com/matlabcentral/answers/1590659-code-generation-information-file-does-not-exist but it did not work.
=== Build (Elapsed: 3 sec) ===
### Starting build procedure for: arduino_gettingstarted_a
### Build procedure for arduino_gettingstarted_a aborted due to an error.
Top model targets built:
Model Action Rebuild Reason
====================================================================================
arduino_gettingstarted_a Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 3.2293s
Error:Permission denied

Réponses (1)

Brahmadev
Brahmadev le 14 Sep 2023
Hi Dimas,
The "Permission denied" error message typically indicates a file permission issue or a problem with the file/folder read or write permissions. Since you mentioned that you have permission to write to the Serial port and the hardware test of the Arduino support package works properly, here are a few additional suggestions to help resolve the error:
  1. Check File and Folder Permissions: Verify that you have sufficient permissions to write to the folders where the generated code and build artifacts are stored. Ensure that the user account running MATLAB has write access to the relevant directories. You might need to check the permissions of the build folder, the MATLAB installation folder, and any custom folders specified for code generation.
% You can use the following code to check for write permissions
dirname = 'NameOfDirectoryGoesHere';
if exist(dirname, 'dir')
[status, attr] = fileattrib();
if status && attr.UserWrite
fprintf('Yes, you have write access to directory "%s"', dirname);
else
fprintf('No, no write access to "%s"');
end
else
fprintf('"%s" is not directory', dirname);
end
  1. Run MATLAB with Administrative Privileges: Try running MATLAB with administrative privileges (using 'sudo' or equivalent command) to ensure that it has the necessary permissions to perform the build process and write files to the appropriate locations.
Hope this helps!

Produits


Version

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by