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:
- 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.
dirname = 'NameOfDirectoryGoesHere';
[status, attr] = fileattrib();
if status && attr.UserWrite
fprintf('Yes, you have write access to directory "%s"', dirname);
fprintf('No, no write access to "%s"');
fprintf('"%s" is not directory', dirname);
- 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!