Which files are compiled for external mode?

2 views (last 30 days)
I am trying to follow this example of how to communicate with the Arduino in external mode over Wifi, but the model won't compile. I get an error saying that a variable is undefined in a specific C file. Investigating the file I find that the variable is defined as "extern volatile boolean_T". There is a C++ file in which the variable is defined with the command "volatile boolean", but here's the problem: that file is not included in the long list of files in the report that comes along with the error. The list follows a pattern where every row starts with the path to either a C or C++ compiler, followed by a huge amount of arguments, and finishes with "filename.o" and "filename.c" (or cpp for the C++ compiler lines). "filename" is obviously different for each line, and the file that gives the error is found on one of the lines. The C++ file that actually defines the variable is not, and I believe this to be the problem.
My question is therefore where it is being set which files should be included when the code is generated? Looking at the "Code generation" pane in "Model configuration parameters" gives me no clue. To me it seems completely arbitrary, given that the actual model contains no block regarding the communication. It is possible to include custom code in "Model configuration parameters", but since this is a file that is actually part of the toolbox, I don't think that is the right way to go about it.
Note that I can get the model to compile (and run properly) when I set the communication option to Serial, so obviously the list of files that are included in the compilation is affected by at least some of the settings done in "Model configuration parameters".

Accepted Answer

Biswa Dhal
Biswa Dhal on 15 May 2017
Edited: Biswa Dhal on 15 May 2017
  1 Comment
Rikard Ottemark
Rikard Ottemark on 15 May 2017
Thank you for that information! Updating the support package solved the problem for me.

Sign in to comment.

More Answers (0)

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!