Access Denied error while building model for arduino

8 views (last 30 days)
Hi,
during building process for arduino_gettingstarted (here renamed to test) Simulink project i get Access denied (Odmowa dostępu) error. I've already tried to reinstall Matlab to different directory, tried different working directories and models for arduino. Also in build_exception.mat file (generated after failed build) there is identifier with value 'MATLAB:MKDIR:OSError' which points to folder creation but I don't know where.
Setup tool after first package setup is working. Also using Arduino from Matlab is working
Any idea what is this issue?
Example models for STM32 build normally.
Here is log from Diagnostic Viewer:
=== Build (Elapsed: 26 sec) ===
### Starting build procedure for: test
### Generating code and artifacts to 'Target environment subfolder' folder structure
### Generating code into build folder: C:\MATLAB\AtmelAVR\test
### Invoking Target Language Compiler on test.rtw
### Using System Target File: C:\MATLAB\R2021a\rtw\c\ert\ert.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
### Writing header file test_types.h
### Writing header file test.h
### Writing header file test_private.h
### Writing header file rtwtypes.h
### Writing source file test.c
.
### Writing source file test_data.c
### Writing header file rtmodel.h
### Writing source file ert_main.c
### TLC code generation complete.
### Evaluating PostCodeGenCommand specified in the model
### Build procedure for test aborted due to an error.
Top model targets built:
Model Action Rebuild Reason
=================================================================
test Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 22.5s
Error:Odmowa dostępu.

Answers (1)

Ayush
Ayush on 28 Nov 2024
Edited: Ayush on 28 Nov 2024
Access denied error message suggest that there are permission issues accessing certain files under the MATLAB R2021a support package directory for Arduino. This can happen for a variety of reasons, including but not limited to changes in how MATLAB handles file permissions between versions, or differences in how the support packages were installed or updated. Here are some steps you can take to try to resolve the issue:
1. Run MATLAB as an Administrator:
Running MATLAB as an administrator can sometimes resolve permission issues, as it allows MATLAB to access files and directories that might be restricted under normal user permissions.
Close MATLAB if it's currently open. Right-click on the MATLAB shortcut and select "Run as administrator." Try to connect to your Arduino board again.
2. Check File Permissions
Manually check the file permissions for the indicated files and directories to ensure that the current user has read and write access.
For example, navigate to C:\ProgramData\MATLAB\SupportPackages\R2021a\aIDE in File Explorer. Right-click on the portable directory, then select Properties. Go to the Security tab and ensure that the current user has Full Control, or at least read and write permissions. If not, edit the permissions accordingly.
3. Update or Reinstall Arduino Support Package
The issue might be related to a corrupted installation of the Arduino support package. Updating or reinstalling the package might resolve the problem.
In MATLAB, go to the Home tab, then click on "Add-Ons" > "Manage Add-Ons."Locate the Arduino support package for R2021a. Try to update the package if an update is available. If no updates are available or if updating does not resolve the issue, try uninstalling and then reinstalling the package.
4. Clear MATLAB Cache

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!