SIL主要参考B站视频
视频讲解Simulink的SIL软件在环测试_哔哩哔哩_bilibili
跟着步骤一步一步就能做出来
PIL主要参考CSDN的大佬
逆变器simulink模型——处理器在环测试(PIL)-CSDN博客
模型正确的情况下,也能做出来,我跑了官方的PIL模型,没问题
但是跑我自己的PIL模型就会出现很多报错,在次记录一下
共计遇到三种报错
1.Communications error:the communication channel could not be opened.
电脑串口驱动损坏,若打开Xcom串口助手,则显示串口被占用,串口打开失败
2.已超过从 rtiostream 接口接收数据的超时时间 10 秒。
The timeout of 10 seconds for receiving data from the rtiostream interface has exceeded.
说明串口没往电脑发送数据,检查配置的串口,以及串口是否正确连接到电脑
或者检查串口是否工作正常
我下载板子的测试程序后,发现串口工作不正常,拔插串口线后,工作正常
3.Invalid payload size (256) received during SIL/PIL communication between Simulink and the target application. Check the rtiostream implementation for the target application
这是由于要生成PIL的模块内包含double数据类型,而28335只能处理32位的数据,故一般用single,更正数据类型后,成功跑出来PIL。