Arduino code from Simulink model

6 views (last 30 days)
Muhammad Imran Chughtai
Muhammad Imran Chughtai on 24 May 2022
Answered: 裕之 on 19 Feb 2024
I am trying to use "Embedded Coder Target for Arduino" from Simulink to get Arduino code for my model. Tried following the pdf document that comes with the add-on but still get the following errors:
Error using arduino_ec.Prefs.setBoard (line 75) Unable to find board specification file. Ensure that the path to the Arduino IDE is set correctly, e.g. arduino_ec.Prefs.setArduinoPath('c:arduino-1.0.5')
Error in setup_customtarget_arduino (line 34) arduino_ec.Prefs.setBoard('mega2560'); % Choose a specific board name
Please note I am beginner level in this. All I want is to convert my Simulink model to Arduino code, currently using Mega2560

Answers (2)

Bilal Ozcan
Bilal Ozcan on 25 Oct 2022
Hello All,
I have the same problem. If you have any information, please write it down.
Sincerely,
Bilal

裕之
裕之 on 19 Feb 2024
1.Boards.txtファイルはArduinoIDEの下にはない。
Windowsはここにあった。
C:\Users\****\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
PCによって場所は違うかもしれない。
Arduino15というフォルダを探してみてください。
2.Boards.txtArduinoIDEをインストールしたフォルダにコピーする。
3.C:\*******\arduino_ec_target\arduino_ec\+arduino_ecフォルダにあるPrefs.mを修正する。
71行目をboardsFileの値がBoards.txtの置き場所となるように修正する。
boardsFile = fullfile(arduino_ec.Prefs.getArduinoPath(), 'hardware', 'arduino', 'boards.txt');
'hardware', 'arduino'を削除すればよいと思う。
これでsetup_customtarget_arduino.mが正常終了した。

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!