Cant build model for arduino via Simulink

조회 수: 2 (최근 30일)
Hugo Hebert
Hugo Hebert 2021년 2월 26일
답변: Kothuri 2024년 8월 22일
I've recently installed the "Simulink Support Package for Arduino Hardware", and tried to do the "getting started" basic model with the led blinking.
But when i try to deploy the model on my board, i get this error :
=== Build (Elapsed: 4 sec) ===
### Starting build procedure for: first_step
### Generating code and artifacts to 'Model specific' folder structure
### Generating code into build folder: C:\Users\33687\Desktop\1-ESTACA\Matlab_test\first_step_ert_rtw
### Invoking Target Language Compiler on first_step.rtw
### Using System Target File: C:\Program Files\MATLAB\R2020b\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 first_step_types.h
### Writing header file first_step.h
### Writing header file first_step_private.h
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing source file first_step.c
.
### Writing header file rtmodel.h
### Writing source file first_step_data.c
### Writing source file ert_main.c
Error: File: C:\Program Files\MATLAB\R2020b\rtw\c\tlc\lib\utillib.tlc Line: 4412 Column: 19
Unable to open output file C:\Users\33687\Desktop\1-ESTACA\Matlab_test\first_step_ert_rtw\modelsources.txt [ofstream::open operation failed]
Main program:
==> [00] C:\Program Files\MATLAB\R2020b\rtw\c\tlc\lib\utillib.tlc:SLibCreateBuildSourcesTxtFile(4412)
[01] C:\Program Files\MATLAB\R2020b\rtw\c\tlc\mw\formatwide.tlc:<NONE>(595)
### TLC code generation complete.
### Build procedure for first_step aborted due to an error.
Top model targets built:
Model Action Rebuild Reason
======================================================================
first_step Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 4.267s
Error:Error: Errors occurred - aborting
If anyone got the same problem and resolved it i'll be really grateful !

답변 (1개)

Kothuri
Kothuri 2024년 8월 22일
I understand that you are getting an error when trying to deploy the model onto the Arduino board.
Upon reviewing the error logs/message, I found that the issue is with the file path or permissions when trying to deploy the model. The following steps might help in resolving the error
  • Ensure that you have the necessary permissions to write to the directory “C:\Users\33687\Desktop\1-ESTACA\Matlab_test\first_step_ert_rtw”. You might need to run MATLAB as an administrator.
  • Sometimes, long file paths can cause issues. Move your project to a directory with a shorter path, such as “C:\MATLAB\Projects\first_step”.
  • Delete the contents of the build folder “first_step_ert_rtw” and try building the model again. This helps if there are any corrupted files.
  • Ensure that there is enough disk space available on your drive.
  • Reset the MATLAB path and cache to ensure there are no path issues. Run the following commands in the MATLAB Command Window:
restoredefaultpath;
rehash toolboxcache;
savepath;
  • Restart MATLAB after running these commands.
Below documentation link provides step by step procedure for building the LED Blinking example.

카테고리

Help CenterFile Exchange에서 Run on Target Hardware에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by