Error while uploading Simulink model to an external arduino mega 2560 hardware

When I tried to generate code and upload it on my arduino mega 2560 hardware, I got following error: "### Failed to generate all binary outputs" The detailed error message is with the file attached to this question. Please help me to solve this problem.

11 Kommentare

Hi Omkar,
In the error log, I could see that the file is being shadowed by a file of the same name higher on the MATLAB path. Could you please rename the file name then build it and see if this resolves the issue.
No Sir, I got same problem. Actually the problem is with writing the code to Arduino hardware. The shadowing thing just gave me a warning, not that error.
Are you trying to build a Simscape model to Arduino?
Not a perfectly simscape model. It is a multi domain model. I'm using some Analog blocks and some simscape blocks.
This line is interesting:
error: total size of local objects too large
Is your model too large?
No sir. I'm using original Arduino mega board. And file size is not that much large
Can you share your model so that I can help you better?
I could not look yet, I will look in following hours.
Have you got any solution Sir ?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Birdman
Birdman am 8 Jan. 2018
Hi Omkar,
Firstly, as far as I know, there are many limitations about generating code from a Simscape Block. When I looked into help documentation, I found out this:
Furthermore, it might be good for you to refer to the following links:
Now, when I generated C code from your model, I encountered with a code of more than 1000 lines(exactly 1096 lines). It is relatively lots of code for a simple model. Also, the static file generated for the model, which is simscape target specific file, contains more than 3000 lines of code.
Also, if you read the links, you will see the related stuff for those situations. I believe you can redo the part you did with Simscape Blocks with Simulink blocks from different libraries. Please consider this approach and let me know the results.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by