R2017a arduino_gettingstarted compilation error

I have followed the getting started instructions but get this compiler error: C:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinotarget/registry/../src/MW_ArduinoHWInit.cpp:33:43: error: 'Serial_begin' was not declared in this scope Serial_begin(0, RTT_BAUDRATE_SERIAL0); ^ gmake: * [MW_ArduinoHWInit.o] Error 1 ### Build procedure for model: 'arduino_gettingstarted' aborted due to an error. I am connected to a Mega 2560 and have configured the model for this.
The MATLAB and Simulink HW Support Packages are installed and I have installed the MinGW64 compiler: 'MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.' What am I missing?

 采纳的回答

Hi Justin, Please check if the installed path has this folder: C:\ProgramData\MATLAB\SupportPackages\R2017a\toolbox\target\supportpackages\arduinobase\src

4 个评论

Hi Pradeep - no this was not on the path, C:\ProgramData\MATLAB\SupportPackages\R2017a\toolbox\target\supportpackages\arduinobase\blocks was there, but not this folder. I have added this to the path and saved and tried again, but I get the same error (even after restarting MATLAB).
I have added everything to the path that is in this folder, and below, but still get the same error: C:\ProgramData\MATLAB\SupportPackages\R2017a\toolbox\target\supportpackages.
I assume other people are working successfully with 2017a and an Arduino?
If you found that path missing, it is highly likely the installation of the support package did not complete successfully or got corrupted due to some reason.
It would be recommended if you reinstall the support package again after manually deleting all the files related to the support package.
Step 1. Delete the CONTENTS of "SupportPackages" folder related to your support package, located inside the following MATLAB folder.
C:\ProgramData\MATLAB\SupportPackages\R2017a\toolbox\target\supportpackages\
Step 2: At the MATLAB command prompt, type "supportPackageInstaller".
Step 3: Find the required package and install it again.
Then confirm if installation completes successfully and there is still the same issue.
Thank you Guarav - that has worked! I removed both the MATLAB and Simulink Hardware Support Packages and just re-installed the Simulink Package at the moment (not sure if the MATLAB package has anything to do with).

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Arduino Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by