Error while executing external mode on Arduino Mega
显示 更早的评论
I was trying to build a Simulink model into Arduino Mega 2560 but got an error as follows:-
"Error occurred while executing External Mode MEX-file 'ext_comm': ExtGetTargetPkt() call failed while checking target pkt header. Component:Simulink | Category:Block diagram error Error occurred while executing External Mode MEX-file 'ext_comm': ExtSetTargetPkt() call failed on CLOSE. Ensure target is still running"
Please tell me what is wrong with my model... I have attached my model and error message on diagnostic viewer with this question.
6 个评论
Madhu Govindarajan
2018-1-30
I feel like the sample time might be the issue. Have you tried changing that?
Omkar Bhanap
2018-1-31
Madhu Govindarajan
2018-2-2
You are correct in that the sample time can be set to 1 micro second. But when you are streaming data over serial (External mode) it might not necessarily work.
You can try and slow the sampling time down to something absurdly slow (like 1/10th a of second) and check if this is causing the issue. If it is, then you can adjust different parameters appropriately. If it is not, at least you know for sure that this is not the reason.
Omkar Bhanap
2018-2-8
Madhu Govindarajan
2018-2-8
I ran the model in your attached file without any error messages when I disabled the overrun detection option. I got the same error message when I enabled overrun detection option at 1K Hz sampling time - Error:Error occurred while executing External Mode MEX-file 'ext_comm': ExtGetTargetPkt() call failed while checking target pkt header.
Hopefully that helps. If not, I would recommend slowing the sampling time both on the block and at the model level to 100 Hz or 1 Hz. If that also does not work, please reach out to MathWorks Technical support and they should be able to assist you with this.
Omkar Bhanap
2018-3-20
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Arduino Hardware 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!