Dear reader;
Most of my Simulink models for the Arduino Mega 2560 hang after a successful download upon connecting to the target, though some of them work.
The external mode does work with certain very simple models. I've needed to use the procedure described here to build and connect to my first successful model. For example an analog input>double conversion>Embedded function for a y = u(5/1024); voltage conversion> scope combination works flawlessly. However, as soon as I add another analog input, the connection to the target goes haywire. The minimum not working example is two analog inputs with two scopes. The exact procedure goes like this: the building process is successful, and it says " Model Successfully Downloaded to Arduino Mega 2560 ". But then, upon trying to connect to the target board, the process hangs at " Initializing " and either Matlab crashes or after a while I get " Error occurred while executing External Mode MEX-file 'ext_serial_win32_comm': Timed-out waiting for first connect response packet. " I've also tried to run a simple embedded function with an extended Kalman filter inside (no inputs or outputs on Arduino) and a scope, but the same thing happened.
Details:
- MATLAB Version: 8.0.0.783 (R2012b)
- Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1)
- Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot™ 64-Bit Server VM mixed mode
- Board: Arduino Mega 2560
- Fixed Step Discrete Solver (tried 1, 0.1 sec)
- External mode enabled.
- Baud rates 9600
- Overrun detection enabled, on pin 13
- Computer Lenovo ThinkPad T410i
Any help would be much appreciated.
Gergely
2 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/116035-simulink-hangs-on-connecting-to-arduino-mega-2560-rev3-in-certain-models#comment_227339
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/116035-simulink-hangs-on-connecting-to-arduino-mega-2560-rev3-in-certain-models#comment_227339
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/116035-simulink-hangs-on-connecting-to-arduino-mega-2560-rev3-in-certain-models#comment_524500
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/116035-simulink-hangs-on-connecting-to-arduino-mega-2560-rev3-in-certain-models#comment_524500
Sign in to comment.